]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
Rollup merge of #56044 - matthewjasper:function-param-drop-order, r=cramertj
[rust.git] / src / test / ui / rfc-2093-infer-outlives / regions-outlives-nominal-type-region-rev.rs
1 // Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
2 // arguments (like `'a`) outlive `'b`.
3 //
4 // Rule OutlivesNominalType from RFC 1214.
5
6
7 #![allow(dead_code)]
8
9 mod rev_variant_struct_region {
10     struct Foo<'a> {
11         x: fn(&'a i32),
12     }
13     trait Trait<'a, 'b> {
14         type Out;
15     }
16     impl<'a, 'b> Trait<'a, 'b> for usize {
17         type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
18     }
19 }
20
21
22 fn main() { }