diff options
Diffstat (limited to 'src/test/ui/structs-enums/unit-like-struct-drop-run.rs')
-rw-r--r-- | src/test/ui/structs-enums/unit-like-struct-drop-run.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/test/ui/structs-enums/unit-like-struct-drop-run.rs b/src/test/ui/structs-enums/unit-like-struct-drop-run.rs deleted file mode 100644 index 1e9c269a4..000000000 --- a/src/test/ui/structs-enums/unit-like-struct-drop-run.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -// needs-unwind -// ignore-emscripten no threads support - -// Make sure the destructor is run for unit-like structs. - -use std::thread; - -struct Foo; - -impl Drop for Foo { - fn drop(&mut self) { - panic!("This panic should happen."); - } -} - -pub fn main() { - let x = thread::spawn(move|| { - let _b = Foo; - }).join(); - - let s = x.unwrap_err().downcast::<&'static str>().unwrap(); - assert_eq!(&**s, "This panic should happen."); -} |