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