]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-85765.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[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 |     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 |     *r = 0;
14    |     ^^^^^^ `r` is a `&` reference, so the data it refers to cannot be written
15    |
16 help: consider changing this to be a mutable reference
17    |
18 LL |     let r = &mut mutvar;
19    |             ~~~~~~~~~~~
20
21 error[E0594]: cannot assign to `*x`, which is behind a `&` reference
22   --> $DIR/issue-85765.rs:19:5
23    |
24 LL |     let x: &usize = &mut{0};
25    |         - consider changing this binding's type to be: `&mut usize`
26 LL |
27 LL |     *x = 1;
28    |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
29
30 error[E0594]: cannot assign to `*y`, which is behind a `&` reference
31   --> $DIR/issue-85765.rs:26:5
32    |
33 LL |     let y: &usize = &mut(0);
34    |         - consider changing this binding's type to be: `&mut usize`
35 LL |
36 LL |     *y = 1;
37    |     ^^^^^^ `y` is a `&` reference, so the data it refers to cannot be written
38
39 error: aborting due to 4 previous errors
40
41 Some errors have detailed explanations: E0594, E0596.
42 For more information about an error, try `rustc --explain E0594`.