summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr
blob: 209dae9c1b3e864dc2cd3ad72caffbc2b770cb88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
error: lifetime may not live long enough
  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
   |
LL |     fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
   |                    -         -               ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
   |                    |         |
   |                    |         let's call the lifetime of this reference `'1`
   |                    let's call the lifetime of this reference `'2`
   |
help: consider introducing a named lifetime parameter and update trait if needed
   |
LL |     fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &Foo { f }
   |         ++++            ++           ++

error: lifetime may not live long enough
  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:9:69
   |
LL |     fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
   |                    -          -                                     ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
   |                    |          |
   |                    |          let's call the lifetime of this reference `'1`
   |                    let's call the lifetime of this reference `'2`
   |
help: consider introducing a named lifetime parameter and update trait if needed
   |
LL |     fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
   |         ++++            ++            ++

error: lifetime may not live long enough
  --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:15:58
   |
LL |     fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
   |            --  ---- has type `Pin<&'1 Foo>`              ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
   |            |
   |            lifetime `'a` defined here

error: aborting due to 3 previous errors