Update unexpected_cfgs lint definition with new syntax and diagnostics

This commit is contained in:
Urgau 2023-11-16 19:01:06 +01:00
parent 9b4fe38903
commit 9a942390bf

View File

@ -3135,7 +3135,7 @@
/// ### Example
///
/// ```text
/// rustc --check-cfg 'names()'
/// rustc --check-cfg 'cfg()'
/// ```
///
/// ```rust,ignore (needs command line option)
@ -3146,7 +3146,7 @@
/// This will produce:
///
/// ```text
/// warning: unknown condition name used
/// warning: unexpected `cfg` condition name: `widnows`
/// --> lint_example.rs:1:7
/// |
/// 1 | #[cfg(widnows)]
@ -3157,9 +3157,10 @@
///
/// ### Explanation
///
/// This lint is only active when a `--check-cfg='names(...)'` option has been passed
/// to the compiler and triggers whenever an unknown condition name or value is used.
/// The known condition include names or values passed in `--check-cfg`, `--cfg`, and some
/// This lint is only active when `--check-cfg` arguments are being passed
/// to the compiler and triggers whenever an unexpected condition name or value is used.
///
/// The known condition include names or values passed in `--check-cfg`, and some
/// well-knows names and values built into the compiler.
pub UNEXPECTED_CFGS,
Warn,