Skip to content

Commit bb65219

Browse files
committed
Auto merge of rust-lang#2854 - oli-obk:filter_backtrace, r=oli-obk
Hide backtrace from stderr files fixes rust-lang#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)
2 parents 197f3a0 + 6f5554b commit bb65219

File tree

2 files changed

+2
-62
lines changed

2 files changed

+2
-62
lines changed

src/tools/miri/tests/fail/panic/double_panic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@error-pattern: the program aborted
22
//@normalize-stderr-test: "\| +\^+" -> "| ^"
33
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
4+
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> "$1"
5+
//@normalize-stderr-test: "\n at [^\n]+" -> "$1"
46

57
struct Foo;
68
impl Drop for Foo {

src/tools/miri/tests/fail/panic/double_panic.stderr

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,6 @@ thread 'main' panicked at 'first', $DIR/double_panic.rs:LL:CC
22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33
thread 'main' panicked at 'second', $DIR/double_panic.rs:LL:CC
44
stack backtrace:
5-
0: std::backtrace_rs::backtrace::miri::trace_unsynchronized
6-
at RUSTLIB/std/src/../../backtrace/src/backtrace/miri.rs:LL:CC
7-
1: std::backtrace_rs::backtrace::miri::trace
8-
at RUSTLIB/std/src/../../backtrace/src/backtrace/miri.rs:LL:CC
9-
2: std::backtrace_rs::backtrace::trace_unsynchronized
10-
at RUSTLIB/std/src/../../backtrace/src/backtrace/mod.rs:LL:CC
11-
3: std::sys_common::backtrace::_print_fmt
12-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
13-
4: <std::sys_common::backtrace::_print::DisplayBacktrace as std::fmt::Display>::fmt
14-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
15-
5: std::fmt::write
16-
at RUSTLIB/core/src/fmt/mod.rs:LL:CC
17-
6: <std::sys::PLATFORM::stdio::Stderr as std::io::Write>::write_fmt
18-
at RUSTLIB/std/src/io/mod.rs:LL:CC
19-
7: std::sys_common::backtrace::_print
20-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
21-
8: std::sys_common::backtrace::print
22-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
23-
9: std::panicking::default_hook::{closure#1}
24-
at RUSTLIB/std/src/panicking.rs:LL:CC
25-
10: std::panicking::default_hook
26-
at RUSTLIB/std/src/panicking.rs:LL:CC
27-
11: std::panicking::rust_panic_with_hook
28-
at RUSTLIB/std/src/panicking.rs:LL:CC
29-
12: std::rt::begin_panic::{closure#0}
30-
at RUSTLIB/std/src/panicking.rs:LL:CC
31-
13: std::sys_common::backtrace::__rust_end_short_backtrace
32-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
33-
14: std::rt::begin_panic
34-
at RUSTLIB/std/src/panicking.rs:LL:CC
35-
15: <Foo as std::ops::Drop>::drop
36-
at $DIR/double_panic.rs:LL:CC
37-
16: std::ptr::drop_in_place - shim(Some(Foo))
38-
at RUSTLIB/core/src/ptr/mod.rs:LL:CC
39-
17: main
40-
at $DIR/double_panic.rs:LL:CC
41-
18: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
42-
at RUSTLIB/core/src/ops/function.rs:LL:CC
43-
19: std::sys_common::backtrace::__rust_begin_short_backtrace
44-
at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
45-
20: std::rt::lang_start::{closure#0}
46-
at RUSTLIB/std/src/rt.rs:LL:CC
47-
21: std::ops::function::impls::call_once
48-
at RUSTLIB/core/src/ops/function.rs:LL:CC
49-
22: std::panicking::r#try::do_call
50-
at RUSTLIB/std/src/panicking.rs:LL:CC
51-
23: std::panicking::r#try
52-
at RUSTLIB/std/src/panicking.rs:LL:CC
53-
24: std::panic::catch_unwind
54-
at RUSTLIB/std/src/panic.rs:LL:CC
55-
25: std::rt::lang_start_internal::{closure#2}
56-
at RUSTLIB/std/src/rt.rs:LL:CC
57-
26: std::panicking::r#try::do_call
58-
at RUSTLIB/std/src/panicking.rs:LL:CC
59-
27: std::panicking::r#try
60-
at RUSTLIB/std/src/panicking.rs:LL:CC
61-
28: std::panic::catch_unwind
62-
at RUSTLIB/std/src/panic.rs:LL:CC
63-
29: std::rt::lang_start_internal
64-
at RUSTLIB/std/src/rt.rs:LL:CC
65-
30: std::rt::lang_start
66-
at RUSTLIB/std/src/rt.rs:LL:CC
675
thread panicked while panicking. aborting.
686
error: abnormal termination: the program aborted execution
697
--> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC

0 commit comments

Comments
 (0)