mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
dfbca7ffa8
Small performance improvement when comparing symbols for `maybe_misused_cfg` Improve suggestion for `maybe_misused_cfg` lint
29 lines
926 B
Rust
29 lines
926 B
Rust
#![warn(clippy::maybe_misused_cfg)]
|
|
|
|
fn main() {
|
|
#[cfg(feature = "not-really-a-feature")]
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
|
//~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
|
|
let _ = 1 + 2;
|
|
|
|
#[cfg(all(feature = "right", feature = "wrong"))]
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
|
let _ = 1 + 2;
|
|
|
|
#[cfg(all(feature = "wrong1", any(feature = "right", feature = "wrong2", feature, features)))]
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
|
//~| ERROR: 'feature' may be misspelled as 'features'
|
|
let _ = 1 + 2;
|
|
|
|
#[cfg(test)]
|
|
//~^ ERROR: 'test' may be misspelled as 'tests'
|
|
let _ = 2;
|
|
#[cfg(test)]
|
|
//~^ ERROR: 'test' may be misspelled as 'Test'
|
|
let _ = 2;
|
|
|
|
#[cfg(all(test, test))]
|
|
//~^ ERROR: 'test' may be misspelled as 'tests'
|
|
//~| ERROR: 'test' may be misspelled as 'Test'
|
|
let _ = 2;
|
|
}
|