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