summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hashmap/hashmap-index-mut.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/hashmap/hashmap-index-mut.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/ui/hashmap/hashmap-index-mut.rs b/src/test/ui/hashmap/hashmap-index-mut.rs
new file mode 100644
index 000000000..98448e9d5
--- /dev/null
+++ b/src/test/ui/hashmap/hashmap-index-mut.rs
@@ -0,0 +1,6 @@
+use std::collections::HashMap;
+
+fn main() {
+ let mut map = HashMap::<u32, u32>::new();
+ map[&0] = 1; //~ ERROR cannot assign
+}