We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc512d2 commit 616cf52Copy full SHA for 616cf52
src/test/ui/union/union-nodrop.rs
@@ -13,10 +13,14 @@ impl Drop for NeedDrop {
13
fn drop(&mut self) {}
14
}
15
16
-// Constant expressions allow `NoDrop` to go out of scope,
+// Constant expressios allow `NoDrop` to go out of scope,
17
// unlike a value of the interior type implementing `Drop`.
18
static X: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1;
19
20
+const Y: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1;
21
+
22
+const fn _f() { (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1 }
23
24
// A union that scrubs the drop glue from its inner type
25
union NoDrop<T> { inner: ManuallyDrop<T> }
26
0 commit comments