Changes to uitests

This commit is contained in:
Jonathan Brouwer 2025-12-05 15:08:04 +01:00
parent 71b093fd2c
commit e7df90412c
No known key found for this signature in database
GPG key ID: F13E55D38C971DEF
7 changed files with 44 additions and 10 deletions

View file

@ -1,4 +1,4 @@
#[link(name = "foo", cfg(foo))]
#[link(name = "foo", cfg(false))]
//~^ ERROR: is unstable
extern "C" {}

View file

@ -1,8 +1,8 @@
error[E0658]: link cfg is unstable
--> $DIR/feature-gate-link_cfg.rs:1:22
|
LL | #[link(name = "foo", cfg(foo))]
| ^^^^^^^^
LL | #[link(name = "foo", cfg(false))]
| ^^^^^^^^^^
|
= help: add `#![feature(link_cfg)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

View file

@ -7,7 +7,7 @@
extern crate link_cfg_works_transitive_dylib;
extern crate link_cfg_works_transitive_rlib;
#[link(name = "foo", cfg(foo))]
#[link(name = "foo", cfg(false))]
extern "C" {}
fn main() {}

View file

@ -2,5 +2,6 @@ fn main() {
cfg!(); //~ ERROR macro requires a cfg-pattern
cfg!(123); //~ ERROR malformed `cfg` macro input
cfg!(foo = 123); //~ ERROR malformed `cfg` macro input
cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
cfg!(false, false); //~ ERROR expected 1 cfg-pattern
cfg!(foo); //~ WARN unexpected `cfg` condition name: `foo`
}

View file

@ -29,9 +29,20 @@ LL | cfg!(foo = 123);
error: expected 1 cfg-pattern
--> $DIR/cfg.rs:5:5
|
LL | cfg!(foo, bar);
| ^^^^^^^^^^^^^^
LL | cfg!(false, false);
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
warning: unexpected `cfg` condition name: `foo`
--> $DIR/cfg.rs:6:10
|
LL | cfg!(foo);
| ^^^
|
= help: expected names are: `FALSE` and `test` and 31 more
= help: to expect this configuration use `--check-cfg=cfg(foo)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
error: aborting due to 4 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0539`.

View file

@ -89,9 +89,11 @@ cfg_select! {
cfg_select! {
a + 1 => {}
//~^ ERROR expected one of `(`, `::`, `=>`, or `=`, found `+`
//~| WARN unexpected `cfg` condition name
}
cfg_select! {
cfg!() => {}
//~^ ERROR expected one of `(`, `::`, `=>`, or `=`, found `!`
//~| WARN unexpected `cfg` condition name
}

View file

@ -60,12 +60,32 @@ LL | a + 1 => {}
| ^ expected one of `(`, `::`, `=>`, or `=`
error: expected one of `(`, `::`, `=>`, or `=`, found `!`
--> $DIR/cfg_select.rs:95:8
--> $DIR/cfg_select.rs:96:8
|
LL | cfg!() => {}
| ^ expected one of `(`, `::`, `=>`, or `=`
error: aborting due to 9 previous errors; 1 warning emitted
warning: unexpected `cfg` condition name: `a`
--> $DIR/cfg_select.rs:90:5
|
LL | a + 1 => {}
| ^ help: found config with similar value: `target_feature = "a"`
|
= help: expected names are: `FALSE` and `test` and 31 more
= help: to expect this configuration use `--check-cfg=cfg(a)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition name: `cfg`
--> $DIR/cfg_select.rs:96:5
|
LL | cfg!() => {}
| ^^^
|
= help: to expect this configuration use `--check-cfg=cfg(cfg)`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
error: aborting due to 9 previous errors; 3 warnings emitted
Some errors have detailed explanations: E0537, E0539.
For more information about an error, try `rustc --explain E0537`.