Skip to content

Commit 5160ea7

Browse files
committed
have a test ensure that a panic-during-cleanup only prints one btacktrace by default
1 parent 8121de1 commit 5160ea7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/ui/backtrace.rs

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ fn runtest(me: &str) {
106106
contains_verbose_expected(s, "double"),
107107
"bad output3: {}", s
108108
);
109+
// Make sure it's only one stack trace.
110+
assert_eq!(s.split("stack backtrace").count(), 2);
109111

110112
// Make sure a stack trace isn't printed too many times
111113
//

tests/ui/panics/panic-in-cleanup.run.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ BOOM
66
stack backtrace:
77
thread 'main' panicked at library/core/src/panicking.rs:126:5:
88
panic in a destructor during cleanup
9-
stack backtrace:
109
thread caused non-unwinding panic. aborting.

0 commit comments

Comments
 (0)