diff options
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/panic.rs | 3 | ||||
| -rw-r--r-- | library/std/src/panic/tests.rs | 56 |
2 files changed, 0 insertions, 59 deletions
diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs index d649357a56d..153189b8b03 100644 --- a/library/std/src/panic.rs +++ b/library/std/src/panic.rs @@ -529,6 +529,3 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> { Err(new) => BacktraceStyle::from_u8(new), } } - -#[cfg(test)] -mod tests; 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>>>(); - } -} |
