File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
tests/run-pass/concurrency Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,15 @@ fn panic() {
59
59
assert_eq ! ( * msg, "Hello!" ) ;
60
60
}
61
61
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
+
62
71
fn main ( ) {
63
72
create_and_detach ( ) ;
64
73
create_and_join ( ) ;
@@ -69,4 +78,5 @@ fn main() {
69
78
create_move_in ( ) ;
70
79
create_move_out ( ) ;
71
80
panic ( ) ;
81
+ panic_named ( ) ;
72
82
}
Original file line number Diff line number Diff line change 1
1
warning: thread support is experimental. For example, Miri does not detect data races yet.
2
2
3
3
thread '<unnamed>' panicked at 'Hello!', $DIR/simple.rs:54:9
4
+ thread 'childthread' panicked at 'Hello, world!', $DIR/simple.rs:64:9
You can’t perform that action at this time.
0 commit comments