diff options
| author | Ralf Jung <post@ralfj.de> | 2020-08-30 18:59:57 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-09-13 16:13:20 +0200 |
| commit | e55896aff7ea4e48576bed317b1a9c3d808acfae (patch) | |
| tree | 74a1dcb9c45d2a6d43d25a72e943937aff212f1c | |
| parent | 0ea53f9901d290ef3335061ee46c7853a78139c9 (diff) | |
| download | rust-e55896aff7ea4e48576bed317b1a9c3d808acfae.tar.gz rust-e55896aff7ea4e48576bed317b1a9c3d808acfae.zip | |
make union-drop mem::forget test meaningful
| -rw-r--r-- | src/test/ui/union/union-drop.rs | 8 |
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 } } |
