Static rustc_lint::builtin::UNEXPECTED_CFGS

source ·
pub static UNEXPECTED_CFGS: &'static Lint
Expand description

The unexpected_cfgs lint detects unexpected conditional compilation conditions.


rustc --check-cfg 'cfg()'
fn foo() {}

This will produce:

warning: unexpected `cfg` condition name: `widnows`
1 | #[cfg(widnows)]
  |       ^^^^^^^
  = note: `#[warn(unexpected_cfgs)]` on by default


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.