Skip to content

Commit 35e1fe1

Browse files
committed
also test non-string panic payload
1 parent ee411c2 commit 35e1fe1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

tests/run-pass/catch_panic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fn main() {
4747
test(|_old_val| panic!("Hello from panic: std"));
4848
test(|old_val| panic!(format!("Hello from panic: {:?}", old_val)));
4949
test(|old_val| panic!("Hello from panic: {:?}", old_val));
50+
test(|_old_val| panic!(1337));
5051
// FIXME https://github.com/rust-lang/miri/issues/1071
5152
//test(|_old_val| core::panic!("Hello from panic: core"));
5253
//test(|old_val| core::panic!(&format!("Hello from panic: {:?}", old_val)));

tests/run-pass/catch_panic.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ thread 'main' panicked at 'Hello from panic: 1', $DIR/catch_panic.rs:48:20
44
Caught panic message (String): Hello from panic: 1
55
thread 'main' panicked at 'Hello from panic: 2', $DIR/catch_panic.rs:49:20
66
Caught panic message (String): Hello from panic: 2
7+
thread 'main' panicked at 'Box<Any>', $DIR/catch_panic.rs:50:21
8+
Failed get caught panic message.
79
Success!

0 commit comments

Comments
 (0)