]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/index-mut-help.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / borrowck / index-mut-help.stderr
CommitLineData
416331ca 1error[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 4LL | 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 9error[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 12LL | 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 17error[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 20LL | 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
25error: aborting due to 3 previous errors
26
60c5eb7d
XL
27Some errors have detailed explanations: E0594, E0596.
28For more information about an error, try `rustc --explain E0594`.