2021-05-13 14:42:25 +00:00
|
|
|
// revisions: mirunsafeck thirunsafeck
|
|
|
|
// [thirunsafeck]compile-flags: -Z thir-unsafeck
|
|
|
|
|
2016-08-26 16:23:42 +00:00
|
|
|
use std::rc::Rc;
|
2016-08-22 16:56:14 +00:00
|
|
|
|
2016-08-26 16:23:42 +00:00
|
|
|
union U<T: Copy> {
|
|
|
|
a: T
|
|
|
|
}
|
2016-08-22 16:56:14 +00:00
|
|
|
|
|
|
|
fn main() {
|
2016-08-26 16:23:42 +00:00
|
|
|
let u = U { a: Rc::new(0u32) };
|
2020-09-02 07:40:56 +00:00
|
|
|
//~^ ERROR the trait bound `Rc<u32>: Copy` is not satisfied
|
2016-08-26 16:23:42 +00:00
|
|
|
let u = U::<Rc<u32>> { a: Default::default() };
|
2020-09-02 07:40:56 +00:00
|
|
|
//~^ ERROR the trait bound `Rc<u32>: Copy` is not satisfied
|
2016-08-22 16:56:14 +00:00
|
|
|
}
|