]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/cfg_features.rs
New upstream version 1.76.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / cfg_features.rs
1 #![warn(clippy::maybe_misused_cfg)]
2
3 fn main() {
4 #[cfg(features = "not-really-a-feature")]
5 //~^ ERROR: 'feature' may be misspelled as 'features'
6 //~| NOTE: `-D clippy::maybe-misused-cfg` implied by `-D warnings`
7 let _ = 1 + 2;
8
9 #[cfg(all(feature = "right", features = "wrong"))]
10 //~^ ERROR: 'feature' may be misspelled as 'features'
11 let _ = 1 + 2;
12
13 #[cfg(all(features = "wrong1", any(feature = "right", features = "wrong2", feature, features)))]
14 //~^ ERROR: 'feature' may be misspelled as 'features'
15 //~| ERROR: 'feature' may be misspelled as 'features'
16 let _ = 1 + 2;
17
18 #[cfg(tests)]
19 //~^ ERROR: 'test' may be misspelled as 'tests'
20 let _ = 2;
21 #[cfg(Test)]
22 //~^ ERROR: 'test' may be misspelled as 'Test'
23 let _ = 2;
24
25 #[cfg(all(tests, Test))]
26 //~^ ERROR: 'test' may be misspelled as 'tests'
27 //~| ERROR: 'test' may be misspelled as 'Test'
28 let _ = 2;
29 }