2016-08-26 19:23:42 +03:00
|
|
|
#[derive(Clone)]
|
2016-08-15 16:10:58 +03:00
|
|
|
union U {
|
2016-08-26 19:23:42 +03:00
|
|
|
a: u8
|
2016-08-15 16:10:58 +03:00
|
|
|
}
|
|
|
|
|
|
2016-08-26 19:23:42 +03:00
|
|
|
#[derive(Clone)]
|
2016-08-26 19:23:42 +03:00
|
|
|
union W {
|
2020-10-04 22:24:14 +02:00
|
|
|
a: std::mem::ManuallyDrop<String>
|
2016-08-26 19:23:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2016-08-26 19:23:42 +03:00
|
|
|
|
2016-08-15 16:10:58 +03:00
|
|
|
fn main() {}
|