]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-85765.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / borrowck / issue-85765.stderr
1 error[E0596]: cannot borrow `*rofl` as mutable, as it is behind a `&` reference
2   --> $DIR/issue-85765.rs:5:5
3    |
4 LL |     rofl.push(Vec::new());
5    |     ^^^^^^^^^^^^^^^^^^^^^ `rofl` is a `&` reference, so the data it refers to cannot be borrowed as mutable
6    |
7 help: consider changing this binding's type
8    |
9 LL |     let rofl: &mut Vec<Vec<i32>> = &mut test;
10    |               ~~~~~~~~~~~~~~~~~~
11
12 error[E0594]: cannot assign to `*r`, which is behind a `&` reference
13   --> $DIR/issue-85765.rs:12:5
14    |
15 LL |     *r = 0;
16    |     ^^^^^^ `r` is a `&` reference, so the data it refers to cannot be written
17    |
18 help: consider changing this to be a mutable reference
19    |
20 LL |     let r = &mut mutvar;
21    |             ~~~~~~~~~~~
22
23 error[E0594]: cannot assign to `*x`, which is behind a `&` reference
24   --> $DIR/issue-85765.rs:19:5
25    |
26 LL |     *x = 1;
27    |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
28    |
29 help: consider changing this binding's type
30    |
31 LL |     let x: &mut usize = &mut{0};
32    |            ~~~~~~~~~~
33
34 error[E0594]: cannot assign to `*y`, which is behind a `&` reference
35   --> $DIR/issue-85765.rs:26:5
36    |
37 LL |     *y = 1;
38    |     ^^^^^^ `y` is a `&` reference, so the data it refers to cannot be written
39    |
40 help: consider changing this binding's type
41    |
42 LL |     let y: &mut usize = &mut(0);
43    |            ~~~~~~~~~~
44
45 error: aborting due to 4 previous errors
46
47 Some errors have detailed explanations: E0594, E0596.
48 For more information about an error, try `rustc --explain E0594`.