]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/ty-outlives/projection-where-clause-trait.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / nll / ty-outlives / projection-where-clause-trait.rs
CommitLineData
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
9trait MyTrait<'a> {
10 type Output: 'a;
11}
12
13fn foo<'a, T>() -> &'a ()
14where
15 T: MyTrait<'a>,
16{
17 bar::<T::Output>()
18}
19
20fn bar<'a, T>() -> &'a ()
21where
22 T: 'a,
23{
24 &()
25}
26
27fn main() {}