about summary refs log tree commit diff
path: root/tests/ui/hashmap/hashmap-lifetimes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hashmap/hashmap-lifetimes.rs')
-rw-r--r--tests/ui/hashmap/hashmap-lifetimes.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/hashmap/hashmap-lifetimes.rs b/tests/ui/hashmap/hashmap-lifetimes.rs
new file mode 100644
index 00000000000..295bf3b0e66
--- /dev/null
+++ b/tests/ui/hashmap/hashmap-lifetimes.rs
@@ -0,0 +1,8 @@
+fn main() {
+    let mut my_stuff = std::collections::HashMap::new();
+    my_stuff.insert(0, 42);
+
+    let mut it = my_stuff.iter();
+    my_stuff.insert(1, 43); //~ ERROR cannot borrow
+    it;
+}