Skip to content

Commit c3a74f5

Browse files
committed
test(rustflags): relax compiler panic assertions
1 parent e2946ab commit c3a74f5

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

tests/testsuite/rustflags.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ fn build_rustflags_for_build_scripts() {
967967
.file(
968968
"build.rs",
969969
r#"
970-
fn main() { assert!(cfg!(foo)); }
970+
fn main() { assert!(cfg!(foo), "CFG FOO!"); }
971971
"#,
972972
)
973973
.file(
@@ -986,12 +986,7 @@ fn build_rustflags_for_build_scripts() {
986986
p.cargo("check --target")
987987
.arg(host)
988988
.with_status(101)
989-
.with_stderr_data(str![[r#"
990-
...
991-
assertion failed: cfg!(foo)
992-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
993-
994-
"#]])
989+
.with_stderr_data("...\n[..]CFG FOO![..]\n...")
995990
.run();
996991

997992
// Enabling -Ztarget-applies-to-host should not make a difference without the config setting
@@ -1004,12 +999,7 @@ fn build_rustflags_for_build_scripts() {
1004999
.masquerade_as_nightly_cargo(&["target-applies-to-host"])
10051000
.arg("-Ztarget-applies-to-host")
10061001
.with_status(101)
1007-
.with_stderr_data(str![[r#"
1008-
...
1009-
assertion failed: cfg!(foo)
1010-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1011-
1012-
"#]])
1002+
.with_stderr_data("...\n[..]CFG FOO![..]\n...")
10131003
.run();
10141004

10151005
// When set to false though, the "proper" behavior where host artifacts _only_ pick up on
@@ -1027,24 +1017,14 @@ fn build_rustflags_for_build_scripts() {
10271017
.masquerade_as_nightly_cargo(&["target-applies-to-host"])
10281018
.arg("-Ztarget-applies-to-host")
10291019
.with_status(101)
1030-
.with_stderr_data(str![[r#"
1031-
...
1032-
assertion failed: cfg!(foo)
1033-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1034-
1035-
"#]])
1020+
.with_stderr_data("...\n[..]CFG FOO![..]\n...")
10361021
.run();
10371022
p.cargo("check --target")
10381023
.arg(host)
10391024
.masquerade_as_nightly_cargo(&["target-applies-to-host"])
10401025
.arg("-Ztarget-applies-to-host")
10411026
.with_status(101)
1042-
.with_stderr_data(str![[r#"
1043-
...
1044-
assertion failed: cfg!(foo)
1045-
[NOTE] run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1046-
1047-
"#]])
1027+
.with_stderr_data("...\n[..]CFG FOO![..]\n...")
10481028
.run();
10491029
}
10501030

0 commit comments

Comments
 (0)