]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.rs
Update ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_mismatch-async.rs
1 // edition:2018
2
3 use std::pin::Pin;
4
5 struct Foo;
6
7 impl Foo {
8     async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
9     //~^ ERROR lifetime mismatch
10
11     async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
12     //~^ ERROR lifetime mismatch
13 }
14
15 type Alias<T> = Pin<T>;
16 impl Foo {
17     async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } //~ ERROR E0623
18 }
19
20 fn main() {}