2017-12-10 11:00:20 -06:00
|
|
|
error[E0597]: borrowed value does not live long enough (Ast)
|
|
|
|
--> $DIR/issue-46472.rs:14:10
|
|
|
|
|
|
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-06-27 18:27:47 -05:00
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
|
|
|
|
--> $DIR/issue-46472.rs:13: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-09-25 09:06:28 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed (Mir)
|
2017-12-10 11:00:20 -06:00
|
|
|
--> $DIR/issue-46472.rs:14:10
|
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | &mut 4
|
2018-09-23 10:30:46 -05:00
|
|
|
| ^ creates a temporary which is freed while still in use
|
2017-12-10 11:00:20 -06:00
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | }
|
2018-09-23 10:30:46 -05:00
|
|
|
| - temporary value is freed at the end of this statement
|
2017-12-10 11:00:20 -06:00
|
|
|
|
|
2018-06-27 18:27:47 -05:00
|
|
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
|
|
|
|
--> $DIR/issue-46472.rs:13: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
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-09-25 09:06:28 -05:00
|
|
|
Some errors occurred: E0597, E0716.
|
2018-09-23 10:30:46 -05:00
|
|
|
For more information about an error, try `rustc --explain E0597`.
|