about summary refs log tree commit diff
path: root/tests/ui/hashmap/hashmap-index-mut.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hashmap/hashmap-index-mut.rs')
-rw-r--r--tests/ui/hashmap/hashmap-index-mut.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/hashmap/hashmap-index-mut.rs b/tests/ui/hashmap/hashmap-index-mut.rs
new file mode 100644
index 00000000000..98448e9d5f0
--- /dev/null
+++ b/tests/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
+}