mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Explain why -D warnings doesn't affect linker-warnings
This commit is contained in:
@@ -305,6 +305,18 @@ fn explain_lint_level_source(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(warnings_group) = sess
|
||||
.opts
|
||||
.lint_opts
|
||||
.iter()
|
||||
.find_map(|(opt, level)| (opt == "warnings").then_some(level))
|
||||
.copied()
|
||||
&& warnings_group >= Level::Deny
|
||||
&& level < warnings_group
|
||||
{
|
||||
err.note_once(format!("the `{name}` lint ignores `-D warnings`"));
|
||||
}
|
||||
}
|
||||
|
||||
/// The innermost function for emitting lints implementing the [`trait@Diagnostic`] trait.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
warning: linker stderr: bar
|
||||
|
|
||||
= note: requested on the command line with `-W linker-messages`
|
||||
= note: the `linker_messages` lint ignores `-D warnings`
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
||||
Reference in New Issue
Block a user