1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// compile-flags:-Zverbose #![allow(warnings)] trait Foo<'a> { } impl<'a, T> Foo<'a> for T { } fn foo<'a, T>(x: &T) -> impl Foo<'a> { x //~^ ERROR captures lifetime that does not appear in bounds } fn main() {}