3 use std::collections::HashMap;
7 let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
8 buggy_map.insert(42, &*Box::new(1)); //~ ERROR temporary value dropped while borrowed
10 // but it is ok if we use a temporary
12 buggy_map.insert(43, &*tmp);