2018-04-18 21:26:21 -05:00
|
|
|
#![feature(rustc_attrs)]
|
2017-10-15 00:13:56 -05:00
|
|
|
|
2018-04-18 21:26:21 -05:00
|
|
|
#[rustc_outlives]
|
2019-07-03 05:35:02 -05:00
|
|
|
union Foo<'a, T: Copy> { //~ ERROR rustc_outlives
|
2017-10-15 00:13:56 -05:00
|
|
|
field1: Bar<'a, T>
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type U needs to outlive lifetime 'b
|
2022-06-29 21:33:18 -05:00
|
|
|
#[derive(Clone, Copy)]
|
2019-07-03 05:35:02 -05:00
|
|
|
union Bar<'b, U: Copy> {
|
2017-10-15 00:13:56 -05:00
|
|
|
field2: &'b U
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|