]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-46472.stderr
Rollup merge of #54708 - collin5:b49475, r=Mark-Simulacrum
[rust.git] / src / test / ui / issues / issue-46472.stderr
1 error[E0597]: borrowed value does not live long enough (Ast)
2   --> $DIR/issue-46472.rs:14:10
3    |
4 LL |     &mut 4
5    |          ^ temporary value does not live long enough
6 ...
7 LL | }
8    | - temporary value only lives until here
9    |
10 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
11   --> $DIR/issue-46472.rs:13:8
12    |
13 LL | fn bar<'a>() -> &'a mut u32 {
14    |        ^^
15
16 error[E0716]: temporary value dropped while borrowed (Mir)
17   --> $DIR/issue-46472.rs:14:10
18    |
19 LL |     &mut 4
20    |          ^ creates a temporary which is freed while still in use
21 ...
22 LL | }
23    | - temporary value is freed at the end of this statement
24    |
25 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:8...
26   --> $DIR/issue-46472.rs:13:8
27    |
28 LL | fn bar<'a>() -> &'a mut u32 {
29    |        ^^
30
31 error: aborting due to 2 previous errors
32
33 Some errors occurred: E0597, E0716.
34 For more information about an error, try `rustc --explain E0597`.