]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-addr-of-upvar-self.stderr
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / regions / regions-addr-of-upvar-self.stderr
1 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
2 --> $DIR/regions-addr-of-upvar-self.rs:8:41
3 |
4 LL | let p: &'static mut usize = &mut self.food;
5 | ^^^^^^^^^^^^^^
6 |
7 note: first, the lifetime cannot outlive the lifetime `'_` as defined here...
8 --> $DIR/regions-addr-of-upvar-self.rs:7:18
9 |
10 LL | let _f = || {
11 | ^^
12 note: ...so that closure can access `self`
13 --> $DIR/regions-addr-of-upvar-self.rs:8:41
14 |
15 LL | let p: &'static mut usize = &mut self.food;
16 | ^^^^^^^^^^^^^^
17 = note: but, the lifetime must be valid for the static lifetime...
18 note: ...so that reference does not outlive borrowed content
19 --> $DIR/regions-addr-of-upvar-self.rs:8:41
20 |
21 LL | let p: &'static mut usize = &mut self.food;
22 | ^^^^^^^^^^^^^^
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0495`.