rust/src/test/ui/issues/issue-46471.stderr

22 lines
624 B
Plaintext
Raw Normal View History

2017-12-08 09:20:45 -06:00
error[E0597]: `x` does not live long enough (Ast)
2018-12-25 09:56:47 -06:00
--> $DIR/issue-46471.rs:5:6
2017-12-08 09:20:45 -06:00
|
2018-02-22 18:42:32 -06:00
LL | &x
2017-12-13 19:27:23 -06:00
| ^ borrowed value does not live long enough
2017-12-08 09:20:45 -06:00
...
2018-02-22 18:42:32 -06:00
LL | }
2017-12-08 09:20:45 -06:00
| - borrowed value only lives until here
|
= note: borrowed value must be valid for the static lifetime...
error[E0515]: cannot return reference to local variable `x` (Mir)
2018-12-25 09:56:47 -06:00
--> $DIR/issue-46471.rs:5:5
2017-12-08 09:20:45 -06:00
|
2018-02-22 18:42:32 -06:00
LL | &x
| ^^ returns a reference to data owned by the current function
2017-12-08 09:20:45 -06:00
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0515, E0597.
For more information about an error, try `rustc --explain E0515`.