summaryrefslogtreecommitdiffstats
path: root/src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
blob: f1a3fb0185db7b8364721d72867a42cc9ae4d7ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::pin::Pin;

struct Foo;

impl Foo {
    fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
    //~^ lifetime may not live long enough

    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 {
    fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
    //~^ lifetime may not live long enough
}

fn main() {}