]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_mismatch.rs
1 use std::pin::Pin;
2
3 struct Foo;
4
5 impl Foo {
6     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } //~ ERROR E0623
7
8     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } //~ ERROR E0623
9 }
10
11 type Alias<T> = Pin<T>;
12 impl Foo {
13     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } //~ ERROR E0623
14 }
15
16 fn main() {}