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