Skip to content

Commit e7df904

Browse files
Changes to uitests
1 parent 71b093f commit e7df904

File tree

7 files changed

+44
-10
lines changed

7 files changed

+44
-10
lines changed

tests/ui/feature-gates/feature-gate-link_cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[link(name = "foo", cfg(foo))]
1+
#[link(name = "foo", cfg(false))]
22
//~^ ERROR: is unstable
33
extern "C" {}
44

tests/ui/feature-gates/feature-gate-link_cfg.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0658]: link cfg is unstable
22
--> $DIR/feature-gate-link_cfg.rs:1:22
33
|
4-
LL | #[link(name = "foo", cfg(foo))]
5-
| ^^^^^^^^
4+
LL | #[link(name = "foo", cfg(false))]
5+
| ^^^^^^^^^^
66
|
77
= help: add `#![feature(link_cfg)]` to the crate attributes to enable
88
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

tests/ui/link-native-libs/link-cfg-works.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern crate link_cfg_works_transitive_dylib;
88
extern crate link_cfg_works_transitive_rlib;
99

10-
#[link(name = "foo", cfg(foo))]
10+
#[link(name = "foo", cfg(false))]
1111
extern "C" {}
1212

1313
fn main() {}

tests/ui/macros/cfg.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ fn main() {
22
cfg!(); //~ ERROR macro requires a cfg-pattern
33
cfg!(123); //~ ERROR malformed `cfg` macro input
44
cfg!(foo = 123); //~ ERROR malformed `cfg` macro input
5-
cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
5+
cfg!(false, false); //~ ERROR expected 1 cfg-pattern
6+
cfg!(foo); //~ WARN unexpected `cfg` condition name: `foo`
67
}

tests/ui/macros/cfg.stderr

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,20 @@ LL | cfg!(foo = 123);
2929
error: expected 1 cfg-pattern
3030
--> $DIR/cfg.rs:5:5
3131
|
32-
LL | cfg!(foo, bar);
33-
| ^^^^^^^^^^^^^^
32+
LL | cfg!(false, false);
33+
| ^^^^^^^^^^^^^^^^^^
3434

35-
error: aborting due to 4 previous errors
35+
warning: unexpected `cfg` condition name: `foo`
36+
--> $DIR/cfg.rs:6:10
37+
|
38+
LL | cfg!(foo);
39+
| ^^^
40+
|
41+
= help: expected names are: `FALSE` and `test` and 31 more
42+
= help: to expect this configuration use `--check-cfg=cfg(foo)`
43+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
44+
= note: `#[warn(unexpected_cfgs)]` on by default
45+
46+
error: aborting due to 4 previous errors; 1 warning emitted
3647

3748
For more information about this error, try `rustc --explain E0539`.

tests/ui/macros/cfg_select.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ cfg_select! {
8989
cfg_select! {
9090
a + 1 => {}
9191
//~^ ERROR expected one of `(`, `::`, `=>`, or `=`, found `+`
92+
//~| WARN unexpected `cfg` condition name
9293
}
9394

9495
cfg_select! {
9596
cfg!() => {}
9697
//~^ ERROR expected one of `(`, `::`, `=>`, or `=`, found `!`
98+
//~| WARN unexpected `cfg` condition name
9799
}

tests/ui/macros/cfg_select.stderr

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,32 @@ LL | a + 1 => {}
6060
| ^ expected one of `(`, `::`, `=>`, or `=`
6161

6262
error: expected one of `(`, `::`, `=>`, or `=`, found `!`
63-
--> $DIR/cfg_select.rs:95:8
63+
--> $DIR/cfg_select.rs:96:8
6464
|
6565
LL | cfg!() => {}
6666
| ^ expected one of `(`, `::`, `=>`, or `=`
6767

68-
error: aborting due to 9 previous errors; 1 warning emitted
68+
warning: unexpected `cfg` condition name: `a`
69+
--> $DIR/cfg_select.rs:90:5
70+
|
71+
LL | a + 1 => {}
72+
| ^ help: found config with similar value: `target_feature = "a"`
73+
|
74+
= help: expected names are: `FALSE` and `test` and 31 more
75+
= help: to expect this configuration use `--check-cfg=cfg(a)`
76+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
77+
= note: `#[warn(unexpected_cfgs)]` on by default
78+
79+
warning: unexpected `cfg` condition name: `cfg`
80+
--> $DIR/cfg_select.rs:96:5
81+
|
82+
LL | cfg!() => {}
83+
| ^^^
84+
|
85+
= help: to expect this configuration use `--check-cfg=cfg(cfg)`
86+
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
87+
88+
error: aborting due to 9 previous errors; 3 warnings emitted
6989

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

0 commit comments

Comments
 (0)