]> git.proxmox.com Git - rustc.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
New upstream version 1.63.0+dfsg1
[rustc.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 }
7 //~^ lifetime may not live long enough
8
9 fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
10 //~^ lifetime may not live long enough
11 }
12
13 type Alias<T> = Pin<T>;
14 impl Foo {
15 fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
16 //~^ lifetime may not live long enough
17 }
18
19 fn main() {}