You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I'm not sure how to describe this very well in a sentence. I am able to mutably borrow the innermost values of a HashMap<u32, Vec<int>>, delete the values, then reference them after they were deleted. This code compiles, runs, and barfs out strange numbers.
use std::collections::HashMap;fnmain(){letmut my_stuff:HashMap<u32,Vec<int>> = HashMap::new();
my_stuff.insert(0,vec![1,2,3,4]);// Do bad thingsletmut stuff = vec!();for(_, vec)in my_stuff.mut_iter(){for thing in vec.mut_iter(){
stuff.push(thing);}}
my_stuff.clear();for thing in stuff.iter(){println!("{}",*thing);}}