about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-05-02 23:44:07 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-05-03 22:44:36 +0800
commit3ea420a697d4fe73c1348d40dac02718fcfccbd9 (patch)
tree42ba6b6b31cf8bd2a9b2fe72453bb317abe38d69
parentcb73af3e2da60268e8f5f67871870a86b9fff23d (diff)
downloadrust-3ea420a697d4fe73c1348d40dac02718fcfccbd9.tar.gz
rust-3ea420a697d4fe73c1348d40dac02718fcfccbd9.zip
tests: justify why `want-abort-got-unwind{,2}.rs` ignore additional errors
-rw-r--r--tests/ui/panic-runtime/want-abort-got-unwind.rs12
-rw-r--r--tests/ui/panic-runtime/want-abort-got-unwind2.rs16
2 files changed, 18 insertions, 10 deletions
diff --git a/tests/ui/panic-runtime/want-abort-got-unwind.rs b/tests/ui/panic-runtime/want-abort-got-unwind.rs
index 42cdf8bc662..7a6bd011d9e 100644
--- a/tests/ui/panic-runtime/want-abort-got-unwind.rs
+++ b/tests/ui/panic-runtime/want-abort-got-unwind.rs
@@ -1,16 +1,18 @@
 // ignore-tidy-linelength
 //@ build-fail
-//@ dont-require-annotations: ERROR
 //@ dont-check-compiler-stderr
 //@ aux-build:panic-runtime-unwind.rs
 //@ compile-flags:-C panic=abort
 
+// NOTE: depending on the target's default panic strategy, there can be additional errors that
+// complain about linking two panic runtimes (e.g. precompiled `panic_unwind` if target default
+// panic strategy is unwind, in addition to `panic_runtime_unwind`). These additional errors will
+// not be observed on targets whose default panic strategy is abort, where `panic_abort` is linked
+// in instead.
+//@ dont-require-annotations: ERROR
+
 extern crate panic_runtime_unwind;
 
 fn main() {}
 
 //~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
-// FIXME: These errors are target-dependent, could be served by some "optional error" annotation
-// instead of `dont-require-annotations`.
-//FIXME~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
-//FIXME~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`
diff --git a/tests/ui/panic-runtime/want-abort-got-unwind2.rs b/tests/ui/panic-runtime/want-abort-got-unwind2.rs
index ddf12cd2a9a..da239a675e5 100644
--- a/tests/ui/panic-runtime/want-abort-got-unwind2.rs
+++ b/tests/ui/panic-runtime/want-abort-got-unwind2.rs
@@ -1,17 +1,23 @@
 // ignore-tidy-linelength
 //@ build-fail
-//@ dont-require-annotations: ERROR
 //@ dont-check-compiler-stderr
 //@ aux-build:panic-runtime-unwind.rs
 //@ aux-build:wants-panic-runtime-unwind.rs
 //@ compile-flags:-C panic=abort
 
+// Like `want-abort-got-unwind.rs`, this version checks that if the root binary wants abort panic
+// runtime, that the compiler rejects a setup where a dependency crate in the dependency DAG
+// transitively provides an unwind panic runtime (which also is built with `-Cpanic=unwind`, making
+// that potentially-unwinding).
+
+// NOTE: similar to `want-abort-got-unwind.rs`, there can be additional errors if the target default
+// panic strategy is unwind, because then the precompiled `panic_unwind` would also be linked in,
+// duplicating `panic_runtime_unwind` (transitively). But those additional errors are not important
+// to test intention.
+//@ dont-require-annotations: ERROR
+
 extern crate wants_panic_runtime_unwind;
 
 fn main() {}
 
 //~? ERROR the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort`
-// FIXME: These errors are target-dependent, could be served by some "optional error" annotation
-// instead of `dont-require-annotations`.
-//FIXME~? ERROR cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind
-//FIXME~? ERROR the crate `panic_unwind` requires panic strategy `unwind` which is incompatible with this crate's strategy of `abort`