about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-25 07:03:09 +0000
committerbors <bors@rust-lang.org>2023-04-25 07:03:09 +0000
commitbb65219df487fc23a2901fba25ad472b0b257219 (patch)
tree5ee0f5ebf1ae2cff9d79ea62a448314ad21be83e
parent197f3a05dc6deb1b9503f116d3b64a8708f21ba3 (diff)
parent6f5554bdef72e859380f2b6f6da7f830f66c905a (diff)
downloadrust-bb65219df487fc23a2901fba25ad472b0b257219.tar.gz
rust-bb65219df487fc23a2901fba25ad472b0b257219.zip
Auto merge of #2854 - oli-obk:filter_backtrace, r=oli-obk
Hide backtrace from stderr files

fixes #2853

seems not very important to test in this detail. I could try to keep a few lines at the start around so we know what's going on (they should be fairly reliable)
-rw-r--r--src/tools/miri/tests/fail/panic/double_panic.rs2
-rw-r--r--src/tools/miri/tests/fail/panic/double_panic.stderr62
2 files changed, 2 insertions, 62 deletions
diff --git a/src/tools/miri/tests/fail/panic/double_panic.rs b/src/tools/miri/tests/fail/panic/double_panic.rs
index 8919d51bb2f..c9501d90b3b 100644
--- a/src/tools/miri/tests/fail/panic/double_panic.rs
+++ b/src/tools/miri/tests/fail/panic/double_panic.rs
@@ -1,6 +1,8 @@
 //@error-pattern: the program aborted
 //@normalize-stderr-test: "\| +\^+" -> "| ^"
 //@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
+//@normalize-stderr-test: "\n  +[0-9]+:[^\n]+" -> "$1"
+//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
 
 struct Foo;
 impl Drop for Foo {
diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr
index 6bf13f21601..5384f6f6716 100644
--- a/src/tools/miri/tests/fail/panic/double_panic.stderr
+++ b/src/tools/miri/tests/fail/panic/double_panic.stderr
@@ -2,68 +2,6 @@ thread 'main' panicked at 'first', $DIR/double_panic.rs:LL:CC
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 thread 'main' panicked at 'second', $DIR/double_panic.rs:LL:CC
 stack backtrace:
-   0: std::backtrace_rs::backtrace::miri::trace_unsynchronized
- at RUSTLIB/std/src/../../backtrace/src/backtrace/miri.rs:LL:CC
-   1: std::backtrace_rs::backtrace::miri::trace
- at RUSTLIB/std/src/../../backtrace/src/backtrace/miri.rs:LL:CC
-   2: std::backtrace_rs::backtrace::trace_unsynchronized
- at RUSTLIB/std/src/../../backtrace/src/backtrace/mod.rs:LL:CC
-   3: std::sys_common::backtrace::_print_fmt
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-   4: <std::sys_common::backtrace::_print::DisplayBacktrace as std::fmt::Display>::fmt
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-   5: std::fmt::write
- at RUSTLIB/core/src/fmt/mod.rs:LL:CC
-   6: <std::sys::PLATFORM::stdio::Stderr as std::io::Write>::write_fmt
- at RUSTLIB/std/src/io/mod.rs:LL:CC
-   7: std::sys_common::backtrace::_print
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-   8: std::sys_common::backtrace::print
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-   9: std::panicking::default_hook::{closure#1}
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  10: std::panicking::default_hook
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  11: std::panicking::rust_panic_with_hook
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  12: std::rt::begin_panic::{closure#0}
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  13: std::sys_common::backtrace::__rust_end_short_backtrace
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-  14: std::rt::begin_panic
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  15: <Foo as std::ops::Drop>::drop
- at $DIR/double_panic.rs:LL:CC
-  16: std::ptr::drop_in_place - shim(Some(Foo))
- at RUSTLIB/core/src/ptr/mod.rs:LL:CC
-  17: main
- at $DIR/double_panic.rs:LL:CC
-  18: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
- at RUSTLIB/core/src/ops/function.rs:LL:CC
-  19: std::sys_common::backtrace::__rust_begin_short_backtrace
- at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
-  20: std::rt::lang_start::{closure#0}
- at RUSTLIB/std/src/rt.rs:LL:CC
-  21: std::ops::function::impls::call_once
- at RUSTLIB/core/src/ops/function.rs:LL:CC
-  22: std::panicking::r#try::do_call
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  23: std::panicking::r#try
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  24: std::panic::catch_unwind
- at RUSTLIB/std/src/panic.rs:LL:CC
-  25: std::rt::lang_start_internal::{closure#2}
- at RUSTLIB/std/src/rt.rs:LL:CC
-  26: std::panicking::r#try::do_call
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  27: std::panicking::r#try
- at RUSTLIB/std/src/panicking.rs:LL:CC
-  28: std::panic::catch_unwind
- at RUSTLIB/std/src/panic.rs:LL:CC
-  29: std::rt::lang_start_internal
- at RUSTLIB/std/src/rt.rs:LL:CC
-  30: std::rt::lang_start
- at RUSTLIB/std/src/rt.rs:LL:CC
 thread panicked while panicking. aborting.
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC