]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/ty-outlives/impl-trait-captures.rs
Rollup merge of #94467 - ibraheemdev:master, r=pnkfelix
[rust.git] / src / test / ui / nll / ty-outlives / impl-trait-captures.rs
1 // compile-flags:-Zverbose
2
3 #![allow(warnings)]
4
5 trait Foo<'a> {
6 }
7
8 impl<'a, T> Foo<'a> for T { }
9
10 fn foo<'a, T>(x: &T) -> impl Foo<'a> {
11     x
12     //~^ ERROR captures lifetime that does not appear in bounds
13 }
14
15 fn main() {}