]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / ty-outlives / projection-where-clause-trait.rs
1 // Test that we are able to establish that `<T as
2 // MyTrait<'a>>::Output: 'a` outlives `'a` (because the trait says
3 // so).
4 //
5 // check-pass
6
7 trait MyTrait<'a> {
8 type Output: 'a;
9 }
10
11 fn foo<'a, T>() -> &'a ()
12 where
13 T: MyTrait<'a>,
14 {
15 bar::<T::Output>()
16 }
17
18 fn bar<'a, T>() -> &'a ()
19 where
20 T: 'a,
21 {
22 &()
23 }
24
25 fn main() {}