2023-08-24 14:32:12 -05:00
|
|
|
#![warn(clippy::maybe_misused_cfg)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[cfg(feature = "not-really-a-feature")]
|
2023-12-01 11:21:58 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
2023-08-24 14:32:12 -05:00
|
|
|
//~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
|
|
|
|
let _ = 1 + 2;
|
|
|
|
|
|
|
|
#[cfg(all(feature = "right", feature = "wrong"))]
|
2023-12-01 11:21:58 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
2023-08-24 14:32:12 -05:00
|
|
|
let _ = 1 + 2;
|
|
|
|
|
|
|
|
#[cfg(all(feature = "wrong1", any(feature = "right", feature = "wrong2", feature, features)))]
|
2023-12-01 11:21:58 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
|
|
|
//~| ERROR: 'feature' may be misspelled as 'features'
|
2023-08-24 14:32:12 -05:00
|
|
|
let _ = 1 + 2;
|
2023-12-01 11:21:58 -06:00
|
|
|
|
|
|
|
#[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;
|
2023-08-24 14:32:12 -05:00
|
|
|
}
|