]> git.proxmox.com Git - rustc.git/blob - tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / rfc-2093-infer-outlives / regions-outlives-nominal-type-type-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 variant_struct_type {
10 struct Foo<T> {
11 x: fn(T)
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 i32>; //~ ERROR reference has a longer lifetime
18 }
19 }
20
21
22 fn main() { }