File tree 3 files changed +56
-0
lines changed
3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ //@run-rustfix
2
+
3
+ #![allow(unused)]
4
+
5
+ #[cfg(windows)]
6
+ fn hermit() {}
7
+
8
+ #[cfg(windows)]
9
+ fn wasi() {}
10
+
11
+ #[cfg(all(unix, not(windows)))]
12
+ fn the_end() {}
13
+
14
+ fn main() {}
Original file line number Diff line number Diff line change
1
+ //@run-rustfix
2
+
3
+ #![ allow( unused) ]
4
+
5
+ #[ cfg( all( windows) ) ]
6
+ fn hermit ( ) { }
7
+
8
+ #[ cfg( any( windows) ) ]
9
+ fn wasi ( ) { }
10
+
11
+ #[ cfg( all( any( unix) , all( not( windows) ) ) ) ]
12
+ fn the_end ( ) { }
13
+
14
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: unneeded sub `cfg` when there is only one condition
2
+ --> $DIR/non_minimal_cfg.rs:5:7
3
+ |
4
+ LL | #[cfg(all(windows))]
5
+ | ^^^^^^^^^^^^ help: try: `windows`
6
+ |
7
+ = note: `-D clippy::non-minimal-cfg` implied by `-D warnings`
8
+
9
+ error: unneeded sub `cfg` when there is only one condition
10
+ --> $DIR/non_minimal_cfg.rs:8:7
11
+ |
12
+ LL | #[cfg(any(windows))]
13
+ | ^^^^^^^^^^^^ help: try: `windows`
14
+
15
+ error: unneeded sub `cfg` when there is only one condition
16
+ --> $DIR/non_minimal_cfg.rs:11:11
17
+ |
18
+ LL | #[cfg(all(any(unix), all(not(windows))))]
19
+ | ^^^^^^^^^ help: try: `unix`
20
+
21
+ error: unneeded sub `cfg` when there is only one condition
22
+ --> $DIR/non_minimal_cfg.rs:11:22
23
+ |
24
+ LL | #[cfg(all(any(unix), all(not(windows))))]
25
+ | ^^^^^^^^^^^^^^^^^ help: try: `not(windows)`
26
+
27
+ error: aborting due to 4 previous errors
28
+
You can’t perform that action at this time.
0 commit comments