blob: a2b7f0805683f536c5f5d171a57375b4e7bc5d59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// edition:2018
use std::pin::Pin;
struct Foo;
impl Foo {
async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
//~^ lifetime may not live long enough
async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
//~^ lifetime may not live long enough
}
type Alias<T> = Pin<T>;
impl Foo {
async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
//~^ lifetime may not live long enough
}
fn main() {}
|