about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-08-30 18:59:57 +0200
committerRalf Jung <post@ralfj.de>2020-09-13 16:13:20 +0200
commite55896aff7ea4e48576bed317b1a9c3d808acfae (patch)
tree74a1dcb9c45d2a6d43d25a72e943937aff212f1c
parent0ea53f9901d290ef3335061ee46c7853a78139c9 (diff)
downloadrust-e55896aff7ea4e48576bed317b1a9c3d808acfae.tar.gz
rust-e55896aff7ea4e48576bed317b1a9c3d808acfae.zip
make union-drop mem::forget test meaningful
-rw-r--r--src/test/ui/union/union-drop.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/union/union-drop.rs b/src/test/ui/union/union-drop.rs
index d7d5610cd6a..4df3ed50282 100644
--- a/src/test/ui/union/union-drop.rs
+++ b/src/test/ui/union/union-drop.rs
@@ -48,11 +48,11 @@ fn main() {
         {
             let y = Y { a: S };
         }
-        assert_eq!(CHECK, 2); // 2, dtor of Y is called
+        assert_eq!(CHECK, 2); // 2, Y has no dtor
         {
-            let y2 = Y { a: S };
-            std::mem::forget(y2);
+            let u2 = U { a: 1 };
+            std::mem::forget(u2);
         }
-        assert_eq!(CHECK, 2); // 2, dtor of Y *not* called for y2
+        assert_eq!(CHECK, 2); // 2, dtor of U *not* called for u2
     }
 }