diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-union-move-assign.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-union-move-assign.rs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/test/ui/borrowck/borrowck-union-move-assign.rs b/src/test/ui/borrowck/borrowck-union-move-assign.rs deleted file mode 100644 index 4c96ccdb2..000000000 --- a/src/test/ui/borrowck/borrowck-union-move-assign.rs +++ /dev/null @@ -1,32 +0,0 @@ -use std::mem::ManuallyDrop; - -// Non-copy -struct A; -struct B; - -union U { - a: ManuallyDrop<A>, - b: ManuallyDrop<B>, -} - -fn main() { - unsafe { - { - let mut u = U { a: ManuallyDrop::new(A) }; - let a = u.a; - let a = u.a; //~ ERROR use of moved value: `u` - } - { - let mut u = U { a: ManuallyDrop::new(A) }; - let a = u.a; - u.a = ManuallyDrop::new(A); - let a = u.a; // OK - } - { - let mut u = U { a: ManuallyDrop::new(A) }; - let a = u.a; - u.b = ManuallyDrop::new(B); - let a = u.a; // OK - } - } -} |