Skip to content

Commit

Permalink
Update unexpected_cfgs lint definition with new syntax and diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Nov 21, 2023
1 parent 7a8c020 commit 7397a4d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3135,7 +3135,7 @@ declare_lint! {
/// ### Example
///
/// ```text
/// rustc --check-cfg 'names()'
/// rustc --check-cfg 'cfg()'
/// ```
///
/// ```rust,ignore (needs command line option)
Expand All @@ -3146,7 +3146,7 @@ declare_lint! {
/// This will produce:
///
/// ```text
/// warning: unknown condition name used
/// warning: unexpected `cfg` condition name: `widnows`
/// --> lint_example.rs:1:7
/// |
/// 1 | #[cfg(widnows)]
Expand All @@ -3157,9 +3157,10 @@ declare_lint! {
///
/// ### 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,
Expand Down

0 comments on commit 7397a4d

Please sign in to comment.