]>
Commit | Line | Data |
---|---|---|
04454e1e FG |
1 | // revisions: base nll |
2 | // ignore-compare-mode-nll | |
3 | //[nll] compile-flags: -Z borrowck=mir | |
4 | ||
48663c56 XL |
5 | use std::pin::Pin; |
6 | ||
7 | struct Foo; | |
8 | ||
9 | impl Foo { | |
04454e1e FG |
10 | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } |
11 | //[base]~^ ERROR E0623 | |
12 | //[nll]~^^ lifetime may not live long enough | |
48663c56 | 13 | |
04454e1e FG |
14 | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } |
15 | //[base]~^ ERROR E0623 | |
16 | //[nll]~^^ lifetime may not live long enough | |
48663c56 XL |
17 | } |
18 | ||
19 | type Alias<T> = Pin<T>; | |
20 | impl Foo { | |
04454e1e FG |
21 | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } |
22 | //[base]~^ ERROR E0623 | |
23 | //[nll]~^^ lifetime may not live long enough | |
48663c56 XL |
24 | } |
25 | ||
26 | fn main() {} |