@@ -293,6 +293,7 @@ fn test_retain() {
293
293
}
294
294
295
295
#[ test]
296
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
296
297
fn test_retain_pred_panic_with_hole ( ) {
297
298
let v = ( 0 ..5 ) . map ( Rc :: new) . collect :: < Vec < _ > > ( ) ;
298
299
catch_unwind ( AssertUnwindSafe ( || {
@@ -310,6 +311,7 @@ fn test_retain_pred_panic_with_hole() {
310
311
}
311
312
312
313
#[ test]
314
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
313
315
fn test_retain_pred_panic_no_hole ( ) {
314
316
let v = ( 0 ..5 ) . map ( Rc :: new) . collect :: < Vec < _ > > ( ) ;
315
317
catch_unwind ( AssertUnwindSafe ( || {
@@ -325,6 +327,7 @@ fn test_retain_pred_panic_no_hole() {
325
327
}
326
328
327
329
#[ test]
330
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
328
331
fn test_retain_drop_panic ( ) {
329
332
struct Wrap ( Rc < i32 > ) ;
330
333
@@ -756,6 +759,7 @@ fn test_drain_end_overflow() {
756
759
}
757
760
758
761
#[ test]
762
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
759
763
fn test_drain_leak ( ) {
760
764
static mut DROPS : i32 = 0 ;
761
765
@@ -949,6 +953,7 @@ fn test_into_iter_clone() {
949
953
}
950
954
951
955
#[ test]
956
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
952
957
fn test_into_iter_leak ( ) {
953
958
static mut DROPS : i32 = 0 ;
954
959
@@ -1076,6 +1081,7 @@ fn test_from_iter_specialization_head_tail_drop() {
1076
1081
}
1077
1082
1078
1083
#[ test]
1084
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
1079
1085
fn test_from_iter_specialization_panic_during_iteration_drops ( ) {
1080
1086
let drop_count: Vec < _ > = ( 0 ..=2 ) . map ( |_| Rc :: new ( ( ) ) ) . collect ( ) ;
1081
1087
let src: Vec < _ > = drop_count. iter ( ) . cloned ( ) . collect ( ) ;
@@ -1100,6 +1106,7 @@ fn test_from_iter_specialization_panic_during_iteration_drops() {
1100
1106
}
1101
1107
1102
1108
#[ test]
1109
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
1103
1110
fn test_from_iter_specialization_panic_during_drop_leaks ( ) {
1104
1111
static mut DROP_COUNTER : usize = 0 ;
1105
1112
@@ -1367,9 +1374,8 @@ fn drain_filter_complex() {
1367
1374
}
1368
1375
}
1369
1376
1370
- // FIXME: re-enable emscripten once it can unwind again
1371
1377
#[ test]
1372
- #[ cfg ( not( target_os = "emscripten" ) ) ]
1378
+ #[ cfg_attr ( not( panic = "unwind" ) , should_panic ) ]
1373
1379
fn drain_filter_consumed_panic ( ) {
1374
1380
use std:: rc:: Rc ;
1375
1381
use std:: sync:: Mutex ;
@@ -1419,9 +1425,8 @@ fn drain_filter_consumed_panic() {
1419
1425
}
1420
1426
}
1421
1427
1422
- // FIXME: Re-enable emscripten once it can catch panics
1423
1428
#[ test]
1424
- #[ cfg ( not( target_os = "emscripten" ) ) ]
1429
+ #[ cfg_attr ( not( panic = "unwind" ) , should_panic ) ]
1425
1430
fn drain_filter_unconsumed_panic ( ) {
1426
1431
use std:: rc:: Rc ;
1427
1432
use std:: sync:: Mutex ;
@@ -2314,6 +2319,7 @@ fn test_vec_dedup() {
2314
2319
}
2315
2320
2316
2321
#[ test]
2322
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
2317
2323
fn test_vec_dedup_panicking ( ) {
2318
2324
#[ derive( Debug ) ]
2319
2325
struct Panic < ' a > {
@@ -2370,6 +2376,7 @@ fn test_vec_dedup_panicking() {
2370
2376
2371
2377
// Regression test for issue #82533
2372
2378
#[ test]
2379
+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
2373
2380
fn test_extend_from_within_panicing_clone ( ) {
2374
2381
struct Panic < ' dc > {
2375
2382
drop_count : & ' dc AtomicU32 ,
0 commit comments