summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/cfg_features.fixed
blob: 0fe38f169f9c880a4f67a7970d27c5485687c972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![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;
}