Skip to content

Commit

Permalink
Rename show_warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 16, 2021
1 parent 13fef86 commit 5606d1b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,10 +1172,14 @@ struct OutputOptions {
/// of empty files are not created. If this is None, the output will not
/// be cached (such as when replaying cached messages).
cache_cell: Option<(PathBuf, LazyCell<File>)>,
/// If `true`, display any recorded warning messages.
/// Other types of messages are processed regardless
/// of the value of this flag
show_warnings: bool,
/// If `true`, display any diagnostics.
/// Other types of JSON messages are processed regardless
/// of the value of this flag.
///
/// This is used primarily for cache replay. If you build with `-vv`, the
/// cache will be filled with diagnostics from dependencies. When the
/// cache is replayed without `-vv`, we don't want to show them.
show_diagnostics: bool,
warnings_seen: usize,
errors_seen: usize,
}
Expand All @@ -1193,7 +1197,7 @@ impl OutputOptions {
look_for_metadata_directive,
color,
cache_cell,
show_warnings: true,
show_diagnostics: true,
warnings_seen: 0,
errors_seen: 0,
}
Expand Down Expand Up @@ -1319,7 +1323,7 @@ fn on_stderr_line_inner(
.map(|v| String::from_utf8(v).expect("utf8"))
.expect("strip should never fail")
};
if options.show_warnings {
if options.show_diagnostics {
count_diagnostic(&msg.level, options);
state.emit_diag(msg.level, rendered)?;
}
Expand Down Expand Up @@ -1404,7 +1408,7 @@ fn on_stderr_line_inner(
// from the compiler, so wrap it in an external Cargo JSON message
// indicating which package it came from and then emit it.

if !options.show_warnings {
if !options.show_diagnostics {
return Ok(true);
}

Expand Down Expand Up @@ -1438,15 +1442,15 @@ fn replay_output_cache(
path: PathBuf,
format: MessageFormat,
color: bool,
show_warnings: bool,
show_diagnostics: bool,
) -> Work {
let target = target.clone();
let mut options = OutputOptions {
format,
look_for_metadata_directive: true,
color,
cache_cell: None,
show_warnings,
show_diagnostics,
warnings_seen: 0,
errors_seen: 0,
};
Expand Down

0 comments on commit 5606d1b

Please sign in to comment.