| error[E0597]: borrowed value does not live long enough (Ast) |
| --> $DIR/issue-46472.rs:14:10 |
| | |
| LL | &mut 4 |
| | ^ temporary value does not live long enough |
| ... |
| LL | } |
| | - temporary value only lives until here |
| | |
| 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 |
| | |
| LL | fn bar<'a>() -> &'a mut u32 { |
| | ^^ |
| |
| error[E0515]: cannot return reference to temporary value (Mir) |
| --> $DIR/issue-46472.rs:14:5 |
| | |
| LL | &mut 4 |
| | ^^^^^- |
| | | | |
| | | temporary value created here |
| | 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`. |