]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-addr-of-upvar-self.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-addr-of-upvar-self.stderr
CommitLineData
b7449926 1error[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 4LL | let p: &'static mut usize = &mut self.food;
b7449926
XL
5 | ^^^^^^^^^^^^^^
6 |
e74abb32 7note: 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 |
10LL | let _f = || {
11 | ^^
60c5eb7d 12note: ...so that closure can access `self`
0731742a 13 --> $DIR/regions-addr-of-upvar-self.rs:10:41
b7449926 14 |
532ac7d7 15LL | let p: &'static mut usize = &mut self.food;
b7449926
XL
16 | ^^^^^^^^^^^^^^
17 = note: but, the lifetime must be valid for the static lifetime...
18note: ...so that reference does not outlive borrowed content
0731742a 19 --> $DIR/regions-addr-of-upvar-self.rs:10:41
b7449926 20 |
532ac7d7 21LL | let p: &'static mut usize = &mut self.food;
b7449926
XL
22 | ^^^^^^^^^^^^^^
23
24error: aborting due to previous error
25
e74abb32 26For more information about this error, try `rustc --explain E0495`.