about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-26 13:15:00 +0900
committerGitHub <noreply@github.com>2022-06-26 13:15:00 +0900
commitb1d66d810d9502ab1bca311b776548ced3b1b711 (patch)
treec1985e0ecfa09b450ee6c64a2f3be2f19fe06a69
parentd0828a3915b7245fe8cbe6a038853bff3501613d (diff)
parent50a46b92f6b09e5cab6e8b4f4683cf8518102115 (diff)
downloadrust-b1d66d810d9502ab1bca311b776548ced3b1b711.tar.gz
rust-b1d66d810d9502ab1bca311b776548ced3b1b711.zip
Rollup merge of #98491 - antoyo:fix/ui-test-backtrace-panic-abort, r=Dylan-DPC
Fix backtrace UI test when panic=abort is used

The function `contains_verbose_expected` is only used when the panic strategy is not abort, so it caused a warning when it was abort, which made the UI test failed on stderr comparison.
-rw-r--r--src/test/ui/backtrace.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/ui/backtrace.rs b/src/test/ui/backtrace.rs
index 05ccfcb5060..e2ac43fffc9 100644
--- a/src/test/ui/backtrace.rs
+++ b/src/test/ui/backtrace.rs
@@ -44,6 +44,7 @@ fn expected(fn_name: &str) -> String {
     format!(" backtrace::{}", fn_name)
 }
 
+#[cfg(not(panic = "abort"))]
 fn contains_verbose_expected(s: &str, fn_name: &str) -> bool {
     // HACK(eddyb) work around the fact that verbosely demangled stack traces
     // (from `RUST_BACKTRACE=full`, or, as is the case here, panic-in-panic)