]> git.lizzy.rs Git - rust.git/commitdiff
Fix ui/run-pass/union/union-nodrop.rs test
authorMichael Bradshaw <mjbshaw@google.com>
Sun, 30 Sep 2018 02:49:17 +0000 (19:49 -0700)
committerMichael Bradshaw <mjbshaw@google.com>
Sun, 30 Sep 2018 02:49:17 +0000 (19:49 -0700)
src/test/ui/run-pass/union/union-nodrop.rs

index 4f2456e43bad1b1e2eaa1f998e90400b8b0e1994..d024aca0cd701436308bf7ca7de009dfdd5e2076 100644 (file)
@@ -57,15 +57,13 @@ fn drop(&mut self) {}
 }
 
 fn main() {
-    unsafe {
-        // NoDrop should not make needs_drop true
-        assert!(!needs_drop::<Foo>());
-        assert!(!needs_drop::<NoDrop<u8>>());
-        assert!(!needs_drop::<NoDrop<Box<u8>>>());
-        // presence of other drop types should still work
-        assert!(needs_drop::<Baz>());
-        // drop impl on union itself should work
-        assert!(needs_drop::<ActuallyDrop<u8>>());
-        assert!(needs_drop::<ActuallyDrop<Box<u8>>>());
-    }
+    // NoDrop should not make needs_drop true
+    assert!(!needs_drop::<Foo>());
+    assert!(!needs_drop::<NoDrop<u8>>());
+    assert!(!needs_drop::<NoDrop<Box<u8>>>());
+    // presence of other drop types should still work
+    assert!(needs_drop::<Baz>());
+    // drop impl on union itself should work
+    assert!(needs_drop::<ActuallyDrop<u8>>());
+    assert!(needs_drop::<ActuallyDrop<Box<u8>>>());
 }