Skip to content

Commit 3ea420a

Browse files
committed
tests: justify why want-abort-got-unwind{,2}.rs ignore additional errors
1 parent cb73af3 commit 3ea420a

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

tests/ui/panic-runtime/want-abort-got-unwind.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
// ignore-tidy-linelength
22
//@ build-fail
3-
//@ dont-require-annotations: ERROR
43
//@ dont-check-compiler-stderr
54
//@ aux-build:panic-runtime-unwind.rs
65
//@ compile-flags:-C panic=abort
76

7+
// NOTE: depending on the target's default panic strategy, there can be additional errors that
8+
// complain about linking two panic runtimes (e.g. precompiled `panic_unwind` if target default
9+
// panic strategy is unwind, in addition to `panic_runtime_unwind`). These additional errors will
10+
// not be observed on targets whose default panic strategy is abort, where `panic_abort` is linked
11+
// in instead.
12+
//@ dont-require-annotations: ERROR
13+
814
extern crate panic_runtime_unwind;
915

1016
fn main() {}
1117

1218
//~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
13-
// FIXME: These errors are target-dependent, could be served by some "optional error" annotation
14-
// instead of `dont-require-annotations`.
15-
//FIXME~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
16-
//FIXME~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`

tests/ui/panic-runtime/want-abort-got-unwind2.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
// ignore-tidy-linelength
22
//@ build-fail
3-
//@ dont-require-annotations: ERROR
43
//@ dont-check-compiler-stderr
54
//@ aux-build:panic-runtime-unwind.rs
65
//@ aux-build:wants-panic-runtime-unwind.rs
76
//@ compile-flags:-C panic=abort
87

8+
// Like `want-abort-got-unwind.rs`, this version checks that if the root binary wants abort panic
9+
// runtime, that the compiler rejects a setup where a dependency crate in the dependency DAG
10+
// transitively provides an unwind panic runtime (which also is built with `-Cpanic=unwind`, making
11+
// that potentially-unwinding).
12+
13+
// NOTE: similar to `want-abort-got-unwind.rs`, there can be additional errors if the target default
14+
// panic strategy is unwind, because then the precompiled `panic_unwind` would also be linked in,
15+
// duplicating `panic_runtime_unwind` (transitively). But those additional errors are not important
16+
// to test intention.
17+
//@ dont-require-annotations: ERROR
18+
919
extern crate wants_panic_runtime_unwind;
1020

1121
fn main() {}
1222

1323
//~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
14-
// FIXME: These errors are target-dependent, could be served by some "optional error" annotation
15-
// instead of `dont-require-annotations`.
16-
//FIXME~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
17-
//FIXME~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`

0 commit comments

Comments
 (0)