summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2093-infer-outlives/nested-union.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2093-infer-outlives/nested-union.rs')
-rw-r--r--tests/ui/rfc-2093-infer-outlives/nested-union.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/rfc-2093-infer-outlives/nested-union.rs b/tests/ui/rfc-2093-infer-outlives/nested-union.rs
new file mode 100644
index 000000000..27ebd0b54
--- /dev/null
+++ b/tests/ui/rfc-2093-infer-outlives/nested-union.rs
@@ -0,0 +1,14 @@
+#![feature(rustc_attrs)]
+
+#[rustc_outlives]
+union Foo<'a, T: Copy> { //~ ERROR rustc_outlives
+ field1: Bar<'a, T>
+}
+
+// Type U needs to outlive lifetime 'b
+#[derive(Clone, Copy)]
+union Bar<'b, U: Copy> {
+ field2: &'b U
+}
+
+fn main() {}