@@ -293,6 +293,7 @@ fn test_retain() {
293293}
294294
295295#[ test]
296+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
296297fn test_retain_pred_panic_with_hole ( ) {
297298 let v = ( 0 ..5 ) . map ( Rc :: new) . collect :: < Vec < _ > > ( ) ;
298299 catch_unwind ( AssertUnwindSafe ( || {
@@ -310,6 +311,7 @@ fn test_retain_pred_panic_with_hole() {
310311}
311312
312313#[ test]
314+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
313315fn test_retain_pred_panic_no_hole ( ) {
314316 let v = ( 0 ..5 ) . map ( Rc :: new) . collect :: < Vec < _ > > ( ) ;
315317 catch_unwind ( AssertUnwindSafe ( || {
@@ -325,6 +327,7 @@ fn test_retain_pred_panic_no_hole() {
325327}
326328
327329#[ test]
330+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
328331fn test_retain_drop_panic ( ) {
329332 struct Wrap ( Rc < i32 > ) ;
330333
@@ -756,6 +759,7 @@ fn test_drain_end_overflow() {
756759}
757760
758761#[ test]
762+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
759763fn test_drain_leak ( ) {
760764 static mut DROPS : i32 = 0 ;
761765
@@ -949,6 +953,7 @@ fn test_into_iter_clone() {
949953}
950954
951955#[ test]
956+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
952957fn test_into_iter_leak ( ) {
953958 static mut DROPS : i32 = 0 ;
954959
@@ -1076,6 +1081,7 @@ fn test_from_iter_specialization_head_tail_drop() {
10761081}
10771082
10781083#[ test]
1084+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
10791085fn test_from_iter_specialization_panic_during_iteration_drops ( ) {
10801086 let drop_count: Vec < _ > = ( 0 ..=2 ) . map ( |_| Rc :: new ( ( ) ) ) . collect ( ) ;
10811087 let src: Vec < _ > = drop_count. iter ( ) . cloned ( ) . collect ( ) ;
@@ -1100,6 +1106,7 @@ fn test_from_iter_specialization_panic_during_iteration_drops() {
11001106}
11011107
11021108#[ test]
1109+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
11031110fn test_from_iter_specialization_panic_during_drop_leaks ( ) {
11041111 static mut DROP_COUNTER : usize = 0 ;
11051112
@@ -1367,9 +1374,8 @@ fn drain_filter_complex() {
13671374 }
13681375}
13691376
1370- // FIXME: re-enable emscripten once it can unwind again
13711377#[ test]
1372- #[ cfg ( not( target_os = "emscripten" ) ) ]
1378+ #[ cfg_attr ( not( panic = "unwind" ) , should_panic ) ]
13731379fn drain_filter_consumed_panic ( ) {
13741380 use std:: rc:: Rc ;
13751381 use std:: sync:: Mutex ;
@@ -1419,9 +1425,8 @@ fn drain_filter_consumed_panic() {
14191425 }
14201426}
14211427
1422- // FIXME: Re-enable emscripten once it can catch panics
14231428#[ test]
1424- #[ cfg ( not( target_os = "emscripten" ) ) ]
1429+ #[ cfg_attr ( not( panic = "unwind" ) , should_panic ) ]
14251430fn drain_filter_unconsumed_panic ( ) {
14261431 use std:: rc:: Rc ;
14271432 use std:: sync:: Mutex ;
@@ -2314,6 +2319,7 @@ fn test_vec_dedup() {
23142319}
23152320
23162321#[ test]
2322+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
23172323fn test_vec_dedup_panicking ( ) {
23182324 #[ derive( Debug ) ]
23192325 struct Panic < ' a > {
@@ -2370,6 +2376,7 @@ fn test_vec_dedup_panicking() {
23702376
23712377// Regression test for issue #82533
23722378#[ test]
2379+ #[ cfg_attr( not( panic = "unwind" ) , should_panic) ]
23732380fn test_extend_from_within_panicing_clone ( ) {
23742381 struct Panic < ' dc > {
23752382 drop_count : & ' dc AtomicU32 ,
0 commit comments