]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.base.stderr
Use revisions instead of nll compare mode for `/self/` ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_pin_lifetime_mismatch.base.stderr
1 error[E0623]: lifetime mismatch
2   --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:10:46
3    |
4 LL |     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
5    |                              ----     ----   ^ ...but data from `f` is returned here
6    |                              |
7    |                              this parameter and the return type are declared with different lifetimes...
8    |
9    = note: each elided lifetime in input position becomes a distinct lifetime
10 help: consider introducing a named lifetime parameter and update trait if needed
11    |
12 LL |     fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
13    |         ++++            ++           ++
14
15 error[E0623]: lifetime mismatch
16   --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:76
17    |
18 LL |     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
19    |                               ----              -----------------          ^ ...but data from `f` is returned here
20    |                               |
21    |                               this parameter and the return type are declared with different lifetimes...
22    |
23    = note: each elided lifetime in input position becomes a distinct lifetime
24 help: consider introducing a named lifetime parameter and update trait if needed
25    |
26 LL |     fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
27    |         ++++            ++            ++
28
29 error[E0623]: lifetime mismatch
30   --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:58
31    |
32 LL |     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
33    |                                         ------     ---   ^^^ ...but data from `arg` is returned here
34    |                                         |
35    |                                         this parameter and the return type are declared with different lifetimes...
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0623`.