1
1
use super :: Builder ;
2
2
use crate :: any:: Any ;
3
3
use crate :: mem;
4
+ use crate :: panic:: panic_any;
4
5
use crate :: result;
5
6
use crate :: sync:: {
6
7
mpsc:: { channel, Sender } ,
@@ -183,7 +184,7 @@ fn test_simple_newsched_spawn() {
183
184
}
184
185
185
186
#[ test]
186
- fn test_try_panic_message_static_str ( ) {
187
+ fn test_try_panic_message_string_literal ( ) {
187
188
match thread:: spawn ( move || {
188
189
panic ! ( "static string" ) ;
189
190
} )
@@ -199,9 +200,9 @@ fn test_try_panic_message_static_str() {
199
200
}
200
201
201
202
#[ test]
202
- fn test_try_panic_message_owned_str ( ) {
203
+ fn test_try_panic_any_message_owned_str ( ) {
203
204
match thread:: spawn ( move || {
204
- panic ! ( "owned string" . to_string( ) ) ;
205
+ panic_any ( "owned string" . to_string ( ) ) ;
205
206
} )
206
207
. join ( )
207
208
{
@@ -215,9 +216,9 @@ fn test_try_panic_message_owned_str() {
215
216
}
216
217
217
218
#[ test]
218
- fn test_try_panic_message_any ( ) {
219
+ fn test_try_panic_any_message_any ( ) {
219
220
match thread:: spawn ( move || {
220
- panic ! ( box 413u16 as Box <dyn Any + Send >) ;
221
+ panic_any ( box 413u16 as Box < dyn Any + Send > ) ;
221
222
} )
222
223
. join ( )
223
224
{
@@ -233,10 +234,10 @@ fn test_try_panic_message_any() {
233
234
}
234
235
235
236
#[ test]
236
- fn test_try_panic_message_unit_struct ( ) {
237
+ fn test_try_panic_any_message_unit_struct ( ) {
237
238
struct Juju ;
238
239
239
- match thread:: spawn ( move || panic ! ( Juju ) ) . join ( ) {
240
+ match thread:: spawn ( move || panic_any ( Juju ) ) . join ( ) {
240
241
Err ( ref e) if e. is :: < Juju > ( ) => { }
241
242
Err ( _) | Ok ( ( ) ) => panic ! ( ) ,
242
243
}
0 commit comments