]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/promote-ref-mut-in-let-issue-46557.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / promote-ref-mut-in-let-issue-46557.stderr
1 error[E0515]: cannot return value referencing temporary value
2   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:6:5
3    |
4 LL |     let ref mut x = 1234543;
5    |                     ------- temporary value created here
6 LL |     x
7    |     ^ returns a value referencing data owned by the current function
8
9 error[E0515]: cannot return value referencing temporary value
10   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:11:5
11    |
12 LL |     let (ref mut x, ) = (1234543, );
13    |                         ----------- temporary value created here
14 LL |     x
15    |     ^ returns a value referencing data owned by the current function
16
17 error[E0515]: cannot return value referencing temporary value
18   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:5
19    |
20 LL |       match 1234543 {
21    |       ^     ------- temporary value created here
22    |  _____|
23    | |
24 LL | |         ref mut x => x
25 LL | |     }
26    | |_____^ returns a value referencing data owned by the current function
27
28 error[E0515]: cannot return value referencing temporary value
29   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:21:5
30    |
31 LL |       match (123443,) {
32    |       ^     --------- temporary value created here
33    |  _____|
34    | |
35 LL | |         (ref mut x,) => x,
36 LL | |     }
37    | |_____^ returns a value referencing data owned by the current function
38
39 error[E0515]: cannot return reference to temporary value
40   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:27:5
41    |
42 LL |     &mut 1234543
43    |     ^^^^^-------
44    |     |    |
45    |     |    temporary value created here
46    |     returns a reference to data owned by the current function
47
48 error: aborting due to 5 previous errors
49
50 For more information about this error, try `rustc --explain E0515`.