]> git.proxmox.com Git - rustc.git/blame - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_mismatch.rs
CommitLineData
04454e1e
FG
1// revisions: base nll
2// ignore-compare-mode-nll
3//[nll] compile-flags: -Z borrowck=mir
4
48663c56
XL
5use std::pin::Pin;
6
7struct Foo;
8
9impl 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
19type Alias<T> = Pin<T>;
20impl 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
26fn main() {}