diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-02-04 05:36:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-04 05:36:50 -0500 |
| commit | d2aa3dec8ab901a684ab2347a030f346fec52fb2 (patch) | |
| tree | c79e159465fa77caeca338bd3a103a7fc898603b /library/std/src/panic | |
| parent | 2a8a1911da03907542c317a85a8bdbbc3692640e (diff) | |
| parent | cc7e3a6228e3016c069b7f62ed40004ede6fafb8 (diff) | |
Rollup merge of #135621 - bjorn3:move_tests_to_stdtests, r=Noratrieb
Move some std tests to integration tests Unit tests directly inside of standard library crates require a very fragile way of building that is hard to reproduce outside of bootstrap. Follow up to https://github.com/rust-lang/rust/pull/133859
Diffstat (limited to 'library/std/src/panic')
| -rw-r--r-- | library/std/src/panic/tests.rs | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/library/std/src/panic/tests.rs b/library/std/src/panic/tests.rs deleted file mode 100644 index b37d74011cc..00000000000 --- a/library/std/src/panic/tests.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![allow(dead_code)] - -use crate::cell::RefCell; -use crate::panic::{AssertUnwindSafe, UnwindSafe}; -use crate::rc::Rc; -use crate::sync::{Arc, Mutex, RwLock}; - -struct Foo { - a: i32, -} - -fn assert<T: UnwindSafe + ?Sized>() {} - -#[test] -fn panic_safety_traits() { - assert::<i32>(); - assert::<&i32>(); - assert::<*mut i32>(); - assert::<*const i32>(); - assert::<usize>(); - assert::<str>(); - assert::<&str>(); - assert::<Foo>(); - assert::<&Foo>(); - assert::<Vec<i32>>(); - assert::<String>(); - assert::<RefCell<i32>>(); - assert::<Box<i32>>(); - assert::<Mutex<i32>>(); - assert::<RwLock<i32>>(); - assert::<&Mutex<i32>>(); - assert::<&RwLock<i32>>(); - assert::<Rc<i32>>(); - assert::<Arc<i32>>(); - assert::<Box<[u8]>>(); - - { - trait Trait: UnwindSafe {} - assert::<Box<dyn Trait>>(); - } - - fn bar<T>() { - assert::<Mutex<T>>(); - assert::<RwLock<T>>(); - } - - fn baz<T: UnwindSafe>() { - assert::<Box<T>>(); - assert::<Vec<T>>(); - assert::<RefCell<T>>(); - assert::<AssertUnwindSafe<T>>(); - assert::<&AssertUnwindSafe<T>>(); - assert::<Rc<AssertUnwindSafe<T>>>(); - assert::<Arc<AssertUnwindSafe<T>>>(); - } -} |
