fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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