about summary refs log tree commit diff
path: root/tests/ui/check-cfg/well-known-names.rs
blob: 39fa3a37d1adc09585d470b06ec229c241bdb1d2 (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
30
31
32
33
34
35
36
37
38
39
40
// This test checks that we lint on non well known names and that we don't lint on well known names
//
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --check-cfg=cfg() -Zcheck-cfg-all-expected
//@ normalize-stderr: "`, `" -> "`\n`"

#[cfg(list_all_well_known_cfgs)]
//~^ WARNING unexpected `cfg` condition name
fn in_diagnostics() {}

#[cfg(target_oz = "linux")]
//~^ WARNING unexpected `cfg` condition name
fn target_os_misspell() {}

#[cfg(target_os = "linux")]
fn target_os() {}

#[cfg(features = "foo")]
//~^ WARNING unexpected `cfg` condition name
fn feature_misspell() {}

#[cfg(feature = "foo")]
//~^ WARNING unexpected `cfg` condition name
fn feature() {}

#[cfg(uniw)]
//~^ WARNING unexpected `cfg` condition name
fn unix_misspell() {}

#[cfg(unix)]
fn unix() {}

#[cfg(miri)]
fn miri() {}

#[cfg(doc)]
fn doc() {}

fn main() {}