]>
Commit | Line | Data |
---|---|---|
416331ca | 1 | error[E0596]: cannot borrow data in an index of `std::collections::HashMap<&str, std::string::String>` as mutable |
0731742a | 2 | --> $DIR/index-mut-help.rs:11:5 |
b7449926 | 3 | | |
532ac7d7 | 4 | LL | map["peter"].clear(); |
b7449926 XL |
5 | | ^^^^^^^^^^^^ cannot borrow as mutable |
6 | | | |
7 | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `std::collections::HashMap<&str, std::string::String>` | |
8 | ||
416331ca | 9 | error[E0594]: cannot assign to data in an index of `std::collections::HashMap<&str, std::string::String>` |
0731742a | 10 | --> $DIR/index-mut-help.rs:12:5 |
b7449926 | 11 | | |
532ac7d7 | 12 | LL | map["peter"] = "0".to_string(); |
48663c56 | 13 | | ^^^^^^^^^^^^ cannot assign |
416331ca XL |
14 | | |
15 | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `std::collections::HashMap<&str, std::string::String>` | |
b7449926 | 16 | |
416331ca | 17 | error[E0596]: cannot borrow data in an index of `std::collections::HashMap<&str, std::string::String>` as mutable |
48663c56 | 18 | --> $DIR/index-mut-help.rs:13:13 |
b7449926 | 19 | | |
532ac7d7 | 20 | LL | let _ = &mut map["peter"]; |
48663c56 | 21 | | ^^^^^^^^^^^^^^^^^ cannot borrow as mutable |
b7449926 XL |
22 | | |
23 | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `std::collections::HashMap<&str, std::string::String>` | |
24 | ||
25 | error: aborting due to 3 previous errors | |
26 | ||
60c5eb7d XL |
27 | Some errors have detailed explanations: E0594, E0596. |
28 | For more information about an error, try `rustc --explain E0594`. |