]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-addr-of-upvar-self.stderr
Merge branch 'master' into rusty-hermit
[rust.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:10: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 on the body at 9:18...
8   --> $DIR/regions-addr-of-upvar-self.rs:9:18
9    |
10 LL |         let _f = || {
11    |                  ^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/regions-addr-of-upvar-self.rs:10: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:10: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`.