blob: 387aeeb8a5bb5140f003c24d88fe01b2c0248881 [file] [log] [blame]
error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
--> $DIR/regions-addr-of-self.rs:17:37
|
LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
| ^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5...
--> $DIR/regions-addr-of-self.rs:16:5
|
LL | / pub fn chase_cat(&mut self) {
LL | | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
LL | | *p += 1;
LL | | }
| |_____^
note: ...so that reference does not outlive borrowed content
--> $DIR/regions-addr-of-self.rs:17:37
|
LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
| ^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that reference does not outlive borrowed content
--> $DIR/regions-addr-of-self.rs:17:37
|
LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.