File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This test checks that we lint on non well known names and that we don't lint on well known names
2
+ //
3
+ // check-pass
4
+ // compile-flags: --check-cfg=names() -Z unstable-options
5
+
6
+ #[cfg(target_oz = "linux")]
7
+ //~^ WARNING unexpected `cfg` condition name
8
+ fn target_os_misspell() {}
9
+
10
+ #[cfg(target_os = "linux")]
11
+ fn target_os() {}
12
+
13
+ #[cfg(features = "foo")]
14
+ //~^ WARNING unexpected `cfg` condition name
15
+ fn feature_misspell() {}
16
+
17
+ #[cfg(feature = "foo")]
18
+ fn feature() {}
19
+
20
+ #[cfg(uniw)]
21
+ //~^ WARNING unexpected `cfg` condition name
22
+ fn unix_misspell() {}
23
+
24
+ #[cfg(unix)]
25
+ fn unix() {}
26
+
27
+ fn main() {}
Original file line number Diff line number Diff line change
1
+ warning: unexpected `cfg` condition name
2
+ --> $DIR/well-known-names.rs:6:7
3
+ |
4
+ LL | #[cfg(target_oz = "linux")]
5
+ | ^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ = note: `#[warn(unexpected_cfgs)]` on by default
8
+
9
+ warning: unexpected `cfg` condition name
10
+ --> $DIR/well-known-names.rs:13:7
11
+ |
12
+ LL | #[cfg(features = "foo")]
13
+ | ^^^^^^^^^^^^^^^^
14
+
15
+ warning: unexpected `cfg` condition name
16
+ --> $DIR/well-known-names.rs:20:7
17
+ |
18
+ LL | #[cfg(uniw)]
19
+ | ^^^^
20
+
21
+ warning: 3 warnings emitted
22
+
You can’t perform that action at this time.
0 commit comments