diff options
| author | Jieyou Xu <jieyouxu@outlook.com> | 2025-05-02 23:29:00 +0800 |
|---|---|---|
| committer | Jieyou Xu <jieyouxu@outlook.com> | 2025-05-03 22:44:36 +0800 |
| commit | a6cac47500a43ff872475801a83a70c414e756a1 (patch) | |
| tree | 5a8edaccb5b2802557af8f8c7e3ae3f8f6ae9130 | |
| parent | d7df5bdf2986e596aeaeec38e732711c69ebbce1 (diff) | |
| download | rust-a6cac47500a43ff872475801a83a70c414e756a1.tar.gz rust-a6cac47500a43ff872475801a83a70c414e756a1.zip | |
tests: fix a panic strategy in `cfg_false_no_std-2.rs`
To avoid having target-dependent "unwinding panics are not supported without std" errors, without regressing test intention.
| -rw-r--r-- | tests/ui/cfg/cfg_false_no_std-2.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/ui/cfg/cfg_false_no_std-2.rs b/tests/ui/cfg/cfg_false_no_std-2.rs index 18b2c699fd7..666c90deaf0 100644 --- a/tests/ui/cfg/cfg_false_no_std-2.rs +++ b/tests/ui/cfg/cfg_false_no_std-2.rs @@ -1,7 +1,11 @@ // Error, the linked empty library is `no_std` and doesn't provide a panic handler. -//@ dont-require-annotations: ERROR //@ dont-check-compiler-stderr + +// NOTE: fix a panic strategy to prevent differing errors subject to target's default panic strategy +// which changes between targets. The specific panic strategy doesn't matter for test intention. +//@ compile-flags: -Cpanic=abort + //@ aux-build: cfg_false_lib_no_std_before.rs #![no_std] @@ -11,6 +15,3 @@ extern crate cfg_false_lib_no_std_before as _; fn main() {} //~? ERROR `#[panic_handler]` function required, but not found -// FIXME: This error is target-dependent, could be served by some "optional error" annotation -// instead of `dont-require-annotations`. -//FIXME~? ERROR unwinding panics are not supported without std |
