Skip to content

Commit a6cac47

Browse files
committed
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.
1 parent d7df5bd commit a6cac47

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/ui/cfg/cfg_false_no_std-2.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// Error, the linked empty library is `no_std` and doesn't provide a panic handler.
22

3-
//@ dont-require-annotations: ERROR
43
//@ dont-check-compiler-stderr
4+
5+
// NOTE: fix a panic strategy to prevent differing errors subject to target's default panic strategy
6+
// which changes between targets. The specific panic strategy doesn't matter for test intention.
7+
//@ compile-flags: -Cpanic=abort
8+
59
//@ aux-build: cfg_false_lib_no_std_before.rs
610

711
#![no_std]
@@ -11,6 +15,3 @@ extern crate cfg_false_lib_no_std_before as _;
1115
fn main() {}
1216

1317
//~? ERROR `#[panic_handler]` function required, but not found
14-
// FIXME: This error is target-dependent, could be served by some "optional error" annotation
15-
// instead of `dont-require-annotations`.
16-
//FIXME~? ERROR unwinding panics are not supported without std

0 commit comments

Comments
 (0)