rust/tests/ui/nll/ty-outlives/impl-trait-captures.rs
2024-02-16 20:02:50 +00:00

16 lines
235 B
Rust

//@ compile-flags:-Zverbose-internals
#![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() {}