]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements |
0731742a | 2 | --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
b7449926 | 3 | | |
532ac7d7 | 4 | LL | let p: &'static mut usize = &mut self.food; |
b7449926 XL |
5 | | ^^^^^^^^^^^^^^ |
6 | | | |
e74abb32 | 7 | note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 9:18... |
0731742a | 8 | --> $DIR/regions-addr-of-upvar-self.rs:9:18 |
b7449926 XL |
9 | | |
10 | LL | let _f = || { | |
11 | | ^^ | |
60c5eb7d | 12 | note: ...so that closure can access `self` |
0731742a | 13 | --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
b7449926 | 14 | | |
532ac7d7 | 15 | LL | let p: &'static mut usize = &mut self.food; |
b7449926 XL |
16 | | ^^^^^^^^^^^^^^ |
17 | = note: but, the lifetime must be valid for the static lifetime... | |
18 | note: ...so that reference does not outlive borrowed content | |
0731742a | 19 | --> $DIR/regions-addr-of-upvar-self.rs:10:41 |
b7449926 | 20 | | |
532ac7d7 | 21 | LL | let p: &'static mut usize = &mut self.food; |
b7449926 XL |
22 | | ^^^^^^^^^^^^^^ |
23 | ||
24 | error: aborting due to previous error | |
25 | ||
e74abb32 | 26 | For more information about this error, try `rustc --explain E0495`. |