rust/src/test/ui/issues/issue-46471.stderr
2018-12-25 21:08:33 -07:00

22 lines
606 B
Plaintext

error[E0597]: `x` does not live long enough (Ast)
--> $DIR/issue-46471.rs:5:6
|
LL | &x
| ^ borrowed value does not live long enough
...
LL | }
| - 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)
--> $DIR/issue-46471.rs:5:5
|
LL | &x
| ^^ returns a reference to data owned by the current function
error: aborting due to 2 previous errors
Some errors occurred: E0515, E0597.
For more information about an error, try `rustc --explain E0515`.