]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
0bf4aa26
XL
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//
dfeec247 5// check-pass
0bf4aa26
XL
6
7trait MyTrait<'a> {
8 type Output: 'a;
9}
10
11fn foo<'a, T>() -> &'a ()
12where
13 T: MyTrait<'a>,
14{
15 bar::<T::Output>()
16}
17
18fn bar<'a, T>() -> &'a ()
19where
20 T: 'a,
21{
22 &()
23}
24
25fn main() {}