Skip to content

Commit 79453f4

Browse files
committed
panic-while-printing
1 parent 882b293 commit 79453f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/ui/panics/panic-during-display-formatting.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Check that panics in `Display::fmt` during printing are properly handled.
2+
13
//@ run-pass
24
//@ needs-unwind
35

@@ -18,8 +20,10 @@ impl Display for A {
1820

1921
fn main() {
2022
set_output_capture(Some(Arc::new(Mutex::new(Vec::new()))));
21-
assert!(std::panic::catch_unwind(|| {
22-
eprintln!("{}", A);
23-
})
24-
.is_err());
23+
assert!(
24+
std::panic::catch_unwind(|| {
25+
eprintln!("{}", A);
26+
})
27+
.is_err()
28+
);
2529
}

0 commit comments

Comments
 (0)