]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/many-mutable-borrows.stderr
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / borrowck / many-mutable-borrows.stderr
1 error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable
2   --> $DIR/many-mutable-borrows.rs:2:9
3    |
4 LL |     let v = Vec::new();
5    |         ^ not mutable
6 LL |     v.push(0);
7    |     --------- cannot borrow as mutable
8 LL |     v.push(0);
9    |     --------- cannot borrow as mutable
10 LL |     v.push(0);
11    |     --------- cannot borrow as mutable
12 LL |     v.push(0);
13    |     --------- cannot borrow as mutable
14 LL |     v.push(0);
15    |     --------- cannot borrow as mutable
16 LL |     v.push(0);
17    |     --------- cannot borrow as mutable
18 LL |     v.push(0);
19    |     --------- cannot borrow as mutable
20 LL |     v.push(0);
21    |     --------- cannot borrow as mutable
22 LL |     v.push(0);
23    |     --------- cannot borrow as mutable
24    |
25    = note: ...and 5 other attempted mutable borrows
26 help: consider changing this to be mutable
27    |
28 LL |     let mut v = Vec::new();
29    |         +++
30
31 error: aborting due to previous error
32
33 For more information about this error, try `rustc --explain E0596`.