2017-12-10 11:00:20 -06:00
|
|
|
error[E0597]: borrowed value does not live long enough (Ast)
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-46472.rs:4:10
|
2017-12-10 11:00:20 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | &mut 4
|
2017-12-13 19:27:23 -06:00
|
|
|
| ^ temporary value does not live long enough
|
2017-12-10 11:00:20 -06:00
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | }
|
2017-12-10 11:00:20 -06:00
|
|
|
| - temporary value only lives until here
|
|
|
|
|
|
2018-12-25 09:56:47 -06:00
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 3:8...
|
|
|
|
--> $DIR/issue-46472.rs:3:8
|
2017-12-10 11:00:20 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | fn bar<'a>() -> &'a mut u32 {
|
2018-06-27 18:27:47 -05:00
|
|
|
| ^^
|
2017-12-10 11:00:20 -06:00
|
|
|
|
2018-10-14 09:12:02 -05:00
|
|
|
error[E0515]: cannot return reference to temporary value (Mir)
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/issue-46472.rs:4:5
|
2017-12-10 11:00:20 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | &mut 4
|
2018-10-14 09:12:02 -05:00
|
|
|
| ^^^^^-
|
|
|
|
| | |
|
|
|
|
| | temporary value created here
|
|
|
|
| returns a reference to data owned by the current function
|
2017-12-10 11:00:20 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0515, E0597.
|
2018-10-14 09:12:02 -05:00
|
|
|
For more information about an error, try `rustc --explain E0515`.
|