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

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

16 lines
370 B
Rust
Raw Normal View History

// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
use std::rc::Rc;
union U<T: Copy> {
a: T
}
fn main() {
let u = U { a: Rc::new(0u32) };
//~^ ERROR the trait bound `Rc<u32>: Copy` is not satisfied
let u = U::<Rc<u32>> { a: Default::default() };
//~^ ERROR the trait bound `Rc<u32>: Copy` is not satisfied
}