rust/tests/ui/union/union-copy.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
229 B
Rust
Raw Normal View History

2016-08-26 16:23:42 +00:00
#[derive(Clone)]
union U {
a: u8
}
2016-08-26 16:23:42 +00:00
#[derive(Clone)]
union W {
a: std::mem::ManuallyDrop<String>
}
impl Copy for U {} // OK
2023-03-07 23:55:51 +00:00
impl Copy for W {} //~ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}