]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-mut-method-for-loop-hashmap.stderr
Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pat, r=jackh726
[rust.git] / tests / ui / suggestions / suggest-mut-method-for-loop-hashmap.stderr
1 error[E0594]: cannot assign to `v.v`, which is behind a `&` reference
2   --> $DIR/suggest-mut-method-for-loop-hashmap.rs:17:9
3    |
4 LL |     for (_k, mut v) in map.iter() {
5    |                        ----------
6    |                        |   |
7    |                        |   help: use mutable method: `iter_mut()`
8    |                        this iterator yields `&` references
9 ...
10 LL |         v.v += 1;
11    |         ^^^^^^^^ `v` is a `&` reference, so the data it refers to cannot be written
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0594`.