rust/tests/ui/union/union-copy.rs
2023-03-08 00:00:18 +00:00

15 lines
229 B
Rust

#[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` cannot be implemented for this type
fn main() {}