diff options
Diffstat (limited to 'src/test/ui/hashmap/hashmap-lifetimes.rs')
-rw-r--r-- | src/test/ui/hashmap/hashmap-lifetimes.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/hashmap/hashmap-lifetimes.rs b/src/test/ui/hashmap/hashmap-lifetimes.rs new file mode 100644 index 000000000..295bf3b0e --- /dev/null +++ b/src/test/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; +} |