Skip to content

Commit f2f4e6f

Browse files
committed
also test panic from thread with name
1 parent c26fb59 commit f2f4e6f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/run-pass/concurrency/simple.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ fn panic() {
5959
assert_eq!(*msg, "Hello!");
6060
}
6161

62+
fn panic_named() {
63+
thread::Builder::new().name("childthread".to_string()).spawn(move || {
64+
panic!("Hello, world!");
65+
})
66+
.unwrap()
67+
.join()
68+
.unwrap_err();
69+
}
70+
6271
fn main() {
6372
create_and_detach();
6473
create_and_join();
@@ -69,4 +78,5 @@ fn main() {
6978
create_move_in();
7079
create_move_out();
7180
panic();
81+
panic_named();
7282
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
warning: thread support is experimental. For example, Miri does not detect data races yet.
22

33
thread '<unnamed>' panicked at 'Hello!', $DIR/simple.rs:54:9
4+
thread 'childthread' panicked at 'Hello, world!', $DIR/simple.rs:64:9

0 commit comments

Comments
 (0)