summaryrefslogtreecommitdiffstats
path: root/tests/ui/union/union-generic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/union/union-generic.rs')
-rw-r--r--tests/ui/union/union-generic.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/union/union-generic.rs b/tests/ui/union/union-generic.rs
new file mode 100644
index 000000000..3d68ecb87
--- /dev/null
+++ b/tests/ui/union/union-generic.rs
@@ -0,0 +1,15 @@
+// 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
+}