1 error: unsatisfied lifetime constraints
2 --> $DIR/regions-addr-of-upvar-self.rs:20:17
5 | -- lifetime `'1` represents this closure's body
6 LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
7 | ^ type annotation requires that `'1` must outlive `'static`
9 = note: closure implements `FnMut`, so references to captured variables can't escape the closure
11 error: unsatisfied lifetime constraints
12 --> $DIR/regions-addr-of-upvar-self.rs:20:17
14 LL | pub fn chase_cat(&mut self) {
15 | --------- lifetime `'2` appears in the type of `self`
17 | -- lifetime `'1` represents this closure's body
18 LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
19 | ^ type annotation requires that `'1` must outlive `'2`
21 = note: closure implements `FnMut`, so references to captured variables can't escape the closure
23 error: unsatisfied lifetime constraints
24 --> $DIR/regions-addr-of-upvar-self.rs:19:18
26 LL | pub fn chase_cat(&mut self) {
27 | - let's call the lifetime of this reference `'1`
30 LL | | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
33 | |_________^ closure body requires that `'1` must outlive `'static`
35 error[E0597]: `self` does not live long enough
36 --> $DIR/regions-addr-of-upvar-self.rs:20:46
39 | -- value captured here
40 LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
41 | ^^^^ borrowed value does not live long enough
44 | - `self` dropped here while still borrowed
46 = note: borrowed value must be valid for the static lifetime...
48 error: aborting due to 4 previous errors
50 For more information about this error, try `rustc --explain E0597`.