blob: d02caeb44f1a82380acbdb042adb28dab39485c6 [file] [log] [blame]
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 reference does not outlive borrowed content
--> $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