Skip to content

Commit bad1a45

Browse files
committed
use test instead of unix to be platform-independent
1 parent a6bd7cc commit bad1a45

2 files changed

Lines changed: 23 additions & 15 deletions

File tree

tests/ui/macros/cfg_select.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ cfg_select! {
151151
}
152152

153153
cfg_select! {
154-
unix => {}
155-
unix => {}
154+
test => {}
155+
test => {}
156+
//~^ WARN unreachable configuration predicate
157+
_ => {}
156158
//~^ WARN unreachable configuration predicate
157159
}
158160

tests/ui/macros/cfg_select.stderr

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: none of the predicates in this `cfg_select` evaluated to true
2-
--> $DIR/cfg_select.rs:159:1
2+
--> $DIR/cfg_select.rs:161:1
33
|
44
LL | / cfg_select! {
55
LL | |
@@ -8,49 +8,49 @@ LL | | }
88
| |_^
99

1010
error: none of the predicates in this `cfg_select` evaluated to true
11-
--> $DIR/cfg_select.rs:164:1
11+
--> $DIR/cfg_select.rs:166:1
1212
|
1313
LL | cfg_select! {}
1414
| ^^^^^^^^^^^^^^
1515

1616
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `=>`
17-
--> $DIR/cfg_select.rs:168:5
17+
--> $DIR/cfg_select.rs:170:5
1818
|
1919
LL | => {}
2020
| ^^
2121

2222
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
23-
--> $DIR/cfg_select.rs:173:5
23+
--> $DIR/cfg_select.rs:175:5
2424
|
2525
LL | () => {}
2626
| ^^ expressions are not allowed here
2727

2828
error[E0539]: malformed `cfg_select` macro input
29-
--> $DIR/cfg_select.rs:178:5
29+
--> $DIR/cfg_select.rs:180:5
3030
|
3131
LL | "str" => {}
3232
| ^^^^^ expected a valid identifier here
3333

3434
error[E0539]: malformed `cfg_select` macro input
35-
--> $DIR/cfg_select.rs:183:5
35+
--> $DIR/cfg_select.rs:185:5
3636
|
3737
LL | a::b => {}
3838
| ^^^^ expected a valid identifier here
3939

4040
error[E0537]: invalid predicate `a`
41-
--> $DIR/cfg_select.rs:188:5
41+
--> $DIR/cfg_select.rs:190:5
4242
|
4343
LL | a() => {}
4444
| ^^^
4545

4646
error: expected one of `(`, `::`, `=>`, or `=`, found `+`
47-
--> $DIR/cfg_select.rs:193:7
47+
--> $DIR/cfg_select.rs:195:7
4848
|
4949
LL | a + 1 => {}
5050
| ^ expected one of `(`, `::`, `=>`, or `=`
5151

5252
error: expected one of `(`, `::`, `=>`, or `=`, found `!`
53-
--> $DIR/cfg_select.rs:199:8
53+
--> $DIR/cfg_select.rs:201:8
5454
|
5555
LL | cfg!() => {}
5656
| ^ expected one of `(`, `::`, `=>`, or `=`
@@ -86,11 +86,17 @@ LL | _ => {}
8686
warning: unreachable configuration predicate
8787
--> $DIR/cfg_select.rs:155:5
8888
|
89-
LL | unix => {}
89+
LL | test => {}
9090
| ^^^^ this configuration predicate is never reached
9191

92+
warning: unreachable configuration predicate
93+
--> $DIR/cfg_select.rs:157:5
94+
|
95+
LL | _ => {}
96+
| ^ this configuration predicate is never reached
97+
9298
warning: unexpected `cfg` condition name: `a`
93-
--> $DIR/cfg_select.rs:193:5
99+
--> $DIR/cfg_select.rs:195:5
94100
|
95101
LL | a + 1 => {}
96102
| ^ help: found config with similar value: `target_feature = "a"`
@@ -101,15 +107,15 @@ LL | a + 1 => {}
101107
= note: `#[warn(unexpected_cfgs)]` on by default
102108

103109
warning: unexpected `cfg` condition name: `cfg`
104-
--> $DIR/cfg_select.rs:199:5
110+
--> $DIR/cfg_select.rs:201:5
105111
|
106112
LL | cfg!() => {}
107113
| ^^^
108114
|
109115
= help: to expect this configuration use `--check-cfg=cfg(cfg)`
110116
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
111117

112-
error: aborting due to 9 previous errors; 6 warnings emitted
118+
error: aborting due to 9 previous errors; 7 warnings emitted
113119

114120
Some errors have detailed explanations: E0537, E0539.
115121
For more information about an error, try `rustc --explain E0537`.

0 commit comments

Comments
 (0)