1 2 3 4 5 6 7 8 9 10 11 12 13 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() {}