]> git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/index-mut-help.stderr
New upstream version 1.35.0+dfsg1
[rustc.git] / src / test / ui / borrowck / index-mut-help.stderr
1 error[E0596]: cannot borrow immutable indexed content as mutable
2 --> $DIR/index-mut-help.rs:11:5
3 |
4 LL | map["peter"].clear();
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
9 error[E0594]: cannot assign to immutable indexed content
10 --> $DIR/index-mut-help.rs:12:5
11 |
12 LL | map["peter"] = "0".to_string();
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
14 |
15 = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `std::collections::HashMap<&str, std::string::String>`
16
17 error[E0596]: cannot borrow immutable indexed content as mutable
18 --> $DIR/index-mut-help.rs:13:18
19 |
20 LL | let _ = &mut map["peter"];
21 | ^^^^^^^^^^^^ cannot borrow as mutable
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
27 Some errors occurred: E0594, E0596.
28 For more information about an error, try `rustc --explain E0594`.