summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/many-mutable-borrows.stderr
blob: aa0cbcffd952ba77576a4f1ec90d32f54386cdd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable
  --> $DIR/many-mutable-borrows.rs:2:9
   |
LL |     let v = Vec::new();
   |         ^ not mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
LL |     v.push(0);
   |     --------- cannot borrow as mutable
   |
   = note: ...and 5 other attempted mutable borrows
help: consider changing this to be mutable
   |
LL |     let mut v = Vec::new();
   |         +++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0596`.