diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/union/union-copy.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/union/union-copy.rs b/src/test/ui/union/union-copy.rs new file mode 100644 index 000000000..5c3f8d908 --- /dev/null +++ b/src/test/ui/union/union-copy.rs @@ -0,0 +1,14 @@ +#[derive(Clone)] +union U { + a: u8 +} + +#[derive(Clone)] +union W { + a: std::mem::ManuallyDrop<String> +} + +impl Copy for U {} // OK +impl Copy for W {} //~ ERROR the trait `Copy` may not be implemented for this type + +fn main() {} |