diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs index ee8435e6d6c6..a778779c0fd8 100644 --- a/library/core/tests/array.rs +++ b/library/core/tests/array.rs @@ -392,6 +392,7 @@ fn array_try_from_fn() { assert_eq!(another_array, Err(SomeError::Foo)); } +#[cfg(not(panic = "abort"))] #[test] fn array_try_from_fn_drops_inserted_elements_on_err() { static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0); @@ -415,6 +416,7 @@ fn array_try_from_fn_drops_inserted_elements_on_err() { assert_eq!(DROP_COUNTER.load(Ordering::SeqCst), 2); } +#[cfg(not(panic = "abort"))] #[test] fn array_try_from_fn_drops_inserted_elements_on_panic() { static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0); @@ -438,6 +440,7 @@ fn array_try_from_fn_drops_inserted_elements_on_panic() { assert_eq!(DROP_COUNTER.load(Ordering::SeqCst), 2); } +#[cfg(not(panic = "abort"))] // https://stackoverflow.com/a/59211505 fn catch_unwind_silent(f: F) -> std::thread::Result where diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs index 58563e2061ca..585cfbb90e40 100644 --- a/library/core/tests/iter/adapters/zip.rs +++ b/library/core/tests/iter/adapters/zip.rs @@ -233,6 +233,7 @@ fn test_zip_trusted_random_access_composition() { } #[test] +#[cfg(panic = "unwind")] fn test_zip_trusted_random_access_next_back_drop() { use std::panic::catch_unwind; use std::panic::AssertUnwindSafe; diff --git a/library/core/tests/mem.rs b/library/core/tests/mem.rs index f878017c9779..3b13dc0832fa 100644 --- a/library/core/tests/mem.rs +++ b/library/core/tests/mem.rs @@ -1,5 +1,6 @@ use core::mem::*; +#[cfg(panic = "unwind")] use std::rc::Rc; #[test] @@ -189,6 +190,7 @@ fn uninit_write_slice_cloned_panic_gt() { } #[test] +#[cfg(panic = "unwind")] fn uninit_write_slice_cloned_mid_panic() { use std::panic;