2023-06-01 09:11:28 -05:00
|
|
|
#![warn(clippy::maybe_misused_cfg)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[cfg(features = "not-really-a-feature")]
|
2023-11-18 15:33:01 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
2023-07-28 14:35:48 -05:00
|
|
|
//~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
|
2023-06-01 09:11:28 -05:00
|
|
|
let _ = 1 + 2;
|
|
|
|
|
|
|
|
#[cfg(all(feature = "right", features = "wrong"))]
|
2023-11-18 15:33:01 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
2023-06-01 09:11:28 -05:00
|
|
|
let _ = 1 + 2;
|
|
|
|
|
|
|
|
#[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
|
2023-11-18 15:33:01 -06:00
|
|
|
//~^ ERROR: 'feature' may be misspelled as 'features'
|
|
|
|
//~| ERROR: 'feature' may be misspelled as 'features'
|
2023-06-01 09:11:28 -05:00
|
|
|
let _ = 1 + 2;
|
2023-11-16 04:32:26 -06:00
|
|
|
|
|
|
|
#[cfg(tests)]
|
|
|
|
//~^ ERROR: 'test' may be misspelled as 'tests'
|
|
|
|
let _ = 2;
|
|
|
|
#[cfg(Test)]
|
|
|
|
//~^ ERROR: 'test' may be misspelled as 'Test'
|
|
|
|
let _ = 2;
|
|
|
|
|
|
|
|
#[cfg(all(tests, Test))]
|
|
|
|
//~^ ERROR: 'test' may be misspelled as 'tests'
|
|
|
|
//~| ERROR: 'test' may be misspelled as 'Test'
|
|
|
|
let _ = 2;
|
2023-06-01 09:11:28 -05:00
|
|
|
}
|