File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
tests/run-pass/concurrency Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,16 @@ fn create_move_out() {
49
49
assert_eq ! ( result. len( ) , 6 ) ;
50
50
}
51
51
52
+ fn panic ( ) {
53
+ let result = thread:: spawn ( || {
54
+ panic ! ( "Hello!" )
55
+ } )
56
+ . join ( )
57
+ . unwrap_err ( ) ;
58
+ let msg = result. downcast_ref :: < & ' static str > ( ) . unwrap ( ) ;
59
+ assert_eq ! ( * msg, "Hello!" ) ;
60
+ }
61
+
52
62
fn main ( ) {
53
63
create_and_detach ( ) ;
54
64
create_and_join ( ) ;
@@ -58,4 +68,5 @@ fn main() {
58
68
create_nested_and_join ( ) ;
59
69
create_move_in ( ) ;
60
70
create_move_out ( ) ;
71
+ panic ( ) ;
61
72
}
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
+ thread '<unnamed>' panicked at 'Hello!', $DIR/simple.rs:54:9
You can’t perform that action at this time.
0 commit comments