| error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements |
| --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
| | |
| LL | let p: &'static mut usize = &mut self.food; |
| | ^^^^^^^^^^^^^^ |
| | |
| note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 9:18... |
| --> $DIR/regions-addr-of-upvar-self.rs:9:18 |
| | |
| LL | let _f = || { |
| | ^^ |
| note: ...so that closure can access `self` |
| --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
| | |
| LL | let p: &'static mut usize = &mut self.food; |
| | ^^^^^^^^^^^^^^ |
| = note: but, the lifetime must be valid for the static lifetime... |
| note: ...so that reference does not outlive borrowed content |
| --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
| | |
| LL | let p: &'static mut usize = &mut self.food; |
| | ^^^^^^^^^^^^^^ |
| |
| error: aborting due to previous error |
| |
| For more information about this error, try `rustc --explain E0495`. |