about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <jorge.aparicio@ferrous-systems.com>2025-01-21 14:36:33 +0100
committerJorge Aparicio <jorge.aparicio@ferrous-systems.com>2025-01-21 17:39:15 +0100
commitece8b0c94fae7124696f8a613538e333cd1b0b71 (patch)
tree8cb45446bee953b4f27fc0decc6865822ec854de
parentb5741a36a897dd93936d31ea0c1688f1399a2e06 (diff)
downloadrust-ece8b0c94fae7124696f8a613538e333cd1b0b71.tar.gz
rust-ece8b0c94fae7124696f8a613538e333cd1b0b71.zip
make UI tests that use `--test` work on panic=abort targets
by adding `-Zpanic_abort_test`, which is a no-op on panic=unwind targets

fixes #135819
-rw-r--r--tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs4
-rw-r--r--tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs b/tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
index 37d94830db2..2a27164f9cb 100644
--- a/tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
+++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
@@ -1,4 +1,6 @@
-//@ compile-flags: --test
+// -Zpanic_abort_tests makes this test work on panic=abort targets and
+// it's a no-op on panic=unwind targets
+//@ compile-flags: --test -Zpanic_abort_tests
 //@ run-pass
 
 #![feature(core_intrinsics, generic_assert)]
diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs b/tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs
index 86cc7adb90d..254d59076e5 100644
--- a/tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs
+++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs
@@ -1,4 +1,6 @@
-//@ compile-flags: --test
+// -Zpanic_abort_tests makes this test work on panic=abort targets and
+// it's a no-op on panic=unwind targets
+//@ compile-flags: --test -Zpanic_abort_tests
 // ignore-tidy-linelength
 //@ run-pass