]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hashmap-iter-value-lifetime.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / hashmap-iter-value-lifetime.rs
1 fn main() {
2     let mut my_stuff = std::collections::HashMap::new();
3     my_stuff.insert(0, 42);
4
5     let (_, thing) = my_stuff.iter().next().unwrap();
6
7     my_stuff.clear(); //~ ERROR cannot borrow
8
9     println!("{}", *thing);
10 }