rust/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs
2024-02-16 20:02:50 +00:00

15 lines
228 B
Rust

//@ edition:2018
use std::pin::Pin;
struct Foo;
impl Foo {
async fn f(self: Pin<&Self>) -> impl Clone { self }
//~^ ERROR: captures lifetime that does not appear in bounds
}
fn main() {
{ Pin::new(&Foo).f() };
}