Skip to content

Commit 616cf52

Browse files
SimonSapinoli-obk
authored andcommitted
Extend union-nodrop.rs test
1 parent fc512d2 commit 616cf52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/ui/union/union-nodrop.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ impl Drop for NeedDrop {
1313
fn drop(&mut self) {}
1414
}
1515

16-
// Constant expressions allow `NoDrop` to go out of scope,
16+
// Constant expressios allow `NoDrop` to go out of scope,
1717
// unlike a value of the interior type implementing `Drop`.
1818
static X: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1;
1919

20+
const Y: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1;
21+
22+
const fn _f() { (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1 }
23+
2024
// A union that scrubs the drop glue from its inner type
2125
union NoDrop<T> { inner: ManuallyDrop<T> }
2226

0 commit comments

Comments
 (0)