]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2093-infer-outlives/nested-union.rs
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / rfc-2093-infer-outlives / nested-union.rs
1 #![feature(rustc_attrs)]
2
3 #[rustc_outlives]
4 union Foo<'a, T: Copy> { //~ ERROR rustc_outlives
5     field1: Bar<'a, T>
6 }
7
8 // Type U needs to outlive lifetime 'b
9 #[derive(Clone, Copy)]
10 union Bar<'b, U: Copy> {
11     field2: &'b U
12 }
13
14 fn main() {}