1 error: lifetime may not live long enough
2 --> $DIR/regions-addr-of-upvar-self.rs:8:20
5 | -- lifetime `'1` represents this closure's body
6 LL | let p: &'static mut usize = &mut self.food;
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: lifetime may not live long enough
12 --> $DIR/regions-addr-of-upvar-self.rs:8:20
14 LL | pub fn chase_cat(&mut self) {
15 | - let's call the lifetime of this reference `'1`
17 LL | let p: &'static mut usize = &mut self.food;
18 | ^^^^^^^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static`
20 error[E0597]: `self` does not live long enough
21 --> $DIR/regions-addr-of-upvar-self.rs:8:46
24 | -- value captured here
25 LL | let p: &'static mut usize = &mut self.food;
26 | ------------------ ^^^^ borrowed value does not live long enough
28 | type annotation requires that `self` is borrowed for `'static`
31 | - `self` dropped here while still borrowed
33 error: aborting due to 3 previous errors
35 For more information about this error, try `rustc --explain E0597`.