]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
Rollup merge of #63055 - Mark-Simulacrum:save-analysis-clean-2, r=Xanewok
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_mismatch.rs
1 // compile-fail
2
3 use std::pin::Pin;
4
5 struct Foo;
6
7 impl Foo {
8     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } //~ ERROR E0623
9
10     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } //~ ERROR E0623
11 }
12
13 type Alias<T> = Pin<T>;
14 impl Foo {
15     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } //~ ERROR E0623
16 }
17
18 fn main() {}