]>
Commit | Line | Data |
---|---|---|
0bf4aa26 XL |
1 | #![feature(nll)] |
2 | ||
3 | // Test that we are able to establish that `<T as | |
4 | // MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says | |
5 | // so). | |
6 | // | |
416331ca | 7 | // build-pass (FIXME(62277): could be check-pass?) |
0bf4aa26 XL |
8 | |
9 | trait MyTrait<'a> { | |
10 | type Output: 'a; | |
11 | } | |
12 | ||
13 | fn foo<'a, T>() -> &'a () | |
14 | where | |
15 | T: MyTrait<'a>, | |
16 | { | |
17 | bar::<T::Output>() | |
18 | } | |
19 | ||
20 | fn bar<'a, T>() -> &'a () | |
21 | where | |
22 | T: 'a, | |
23 | { | |
24 | &() | |
25 | } | |
26 | ||
27 | fn main() {} |