mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
add cfg_panic bootstrap
This commit is contained in:
parent
d018a8b624
commit
a889079b29
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user