diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2019-07-04 18:30:41 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-10-11 10:43:54 +0200 |
| commit | 616cf52358a66f0d546aac67a58958e2b50c5f0b (patch) | |
| tree | a2d6a37962f39b93d273f9a2ac4ce33dfb508f95 | |
| parent | fc512d2cdf5ab654e55e25725b7243812f4630d1 (diff) | |
| download | rust-616cf52358a66f0d546aac67a58958e2b50c5f0b.tar.gz rust-616cf52358a66f0d546aac67a58958e2b50c5f0b.zip | |
Extend union-nodrop.rs test
| -rw-r--r-- | src/test/ui/union/union-nodrop.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/ui/union/union-nodrop.rs b/src/test/ui/union/union-nodrop.rs index c99228d7d34..59282bec59b 100644 --- a/src/test/ui/union/union-nodrop.rs +++ b/src/test/ui/union/union-nodrop.rs @@ -13,10 +13,14 @@ impl Drop for NeedDrop { fn drop(&mut self) {} } -// Constant expressions allow `NoDrop` to go out of scope, +// Constant expressios allow `NoDrop` to go out of scope, // unlike a value of the interior type implementing `Drop`. static X: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1; +const Y: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1; + +const fn _f() { (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1 } + // A union that scrubs the drop glue from its inner type union NoDrop<T> { inner: ManuallyDrop<T> } |
