rust/src/test/ui/regions/regions-addr-of-upvar-self.stderr
bstrie 90a2e5e3fe Update tests to remove old numeric constants
Part of #68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29 00:55:55 -05:00

27 lines
1.1 KiB
Plaintext

error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
--> $DIR/regions-addr-of-upvar-self.rs:8:41
|
LL | let p: &'static mut usize = &mut self.food;
| ^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 7:18...
--> $DIR/regions-addr-of-upvar-self.rs:7:18
|
LL | let _f = || {
| ^^
note: ...so that closure can access `self`
--> $DIR/regions-addr-of-upvar-self.rs:8:41
|
LL | let p: &'static mut usize = &mut self.food;
| ^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that reference does not outlive borrowed content
--> $DIR/regions-addr-of-upvar-self.rs:8:41
|
LL | let p: &'static mut usize = &mut self.food;
| ^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0495`.