1 #![feature(associated_type_bounds)]
3 trait Tr1 { type As1; }
4 trait Tr2 { type As2; }
6 struct St
<'a
, 'b
, T
: Tr1
<As1
: Tr2
>> { // `T: 'b` is *not* implied!
7 f0
: &'a T
, // `T: 'a` is implied.
8 f1
: &'b
<T
::As1
as Tr2
>::As2
, // `<T::As1 as Tr2>::As2: 'a` is implied.
11 fn _bad_st
<'a
, 'b
, T
>(x
: St
<'a
, 'b
, T
>)
16 // This should fail because `T: 'b` is not implied from `WF(St<'a, 'b, T>)`.
17 let _failure_proves_not_implied_outlives_region_b
: &'b T
= &x
.f0
;
18 //~^ ERROR lifetime may not live long enough
21 enum En7
<'a
, 'b
, T
> // `<T::As1 as Tr2>::As2: 'a` is implied.
27 V1(&'b
<T
::As1
as Tr2
>::As2
),
30 fn _bad_en7
<'a
, 'b
, T
>(x
: En7
<'a
, 'b
, T
>)
37 // Also fails for the same reason as above:
38 let _failure_proves_not_implied_outlives_region_b
: &'b T
= &x
;
39 //~^ ERROR lifetime may not live long enough