add cfg_panic bootstrap

This commit is contained in:
Charisee 2022-02-04 21:55:22 +00:00
parent d018a8b624
commit a889079b29
3 changed files with 6 additions and 0 deletions

View File

@ -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, R>(f: F) -> std::thread::Result<R>
where

View File

@ -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;

View File

@ -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;