Skip to content

Commit a889079

Browse files
author
Charisee
committed
add cfg_panic bootstrap
1 parent d018a8b commit a889079

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

library/core/tests/array.rs

+3
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ fn array_try_from_fn() {
392392
assert_eq!(another_array, Err(SomeError::Foo));
393393
}
394394

395+
#[cfg(not(panic = "abort"))]
395396
#[test]
396397
fn array_try_from_fn_drops_inserted_elements_on_err() {
397398
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
@@ -415,6 +416,7 @@ fn array_try_from_fn_drops_inserted_elements_on_err() {
415416
assert_eq!(DROP_COUNTER.load(Ordering::SeqCst), 2);
416417
}
417418

419+
#[cfg(not(panic = "abort"))]
418420
#[test]
419421
fn array_try_from_fn_drops_inserted_elements_on_panic() {
420422
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
@@ -438,6 +440,7 @@ fn array_try_from_fn_drops_inserted_elements_on_panic() {
438440
assert_eq!(DROP_COUNTER.load(Ordering::SeqCst), 2);
439441
}
440442

443+
#[cfg(not(panic = "abort"))]
441444
// https://stackoverflow.com/a/59211505
442445
fn catch_unwind_silent<F, R>(f: F) -> std::thread::Result<R>
443446
where

library/core/tests/iter/adapters/zip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ fn test_zip_trusted_random_access_composition() {
233233
}
234234

235235
#[test]
236+
#[cfg(panic = "unwind")]
236237
fn test_zip_trusted_random_access_next_back_drop() {
237238
use std::panic::catch_unwind;
238239
use std::panic::AssertUnwindSafe;

library/core/tests/mem.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use core::mem::*;
22

3+
#[cfg(panic = "unwind")]
34
use std::rc::Rc;
45

56
#[test]
@@ -189,6 +190,7 @@ fn uninit_write_slice_cloned_panic_gt() {
189190
}
190191

191192
#[test]
193+
#[cfg(panic = "unwind")]
192194
fn uninit_write_slice_cloned_mid_panic() {
193195
use std::panic;
194196

0 commit comments

Comments
 (0)