3 #![feature(box_syntax)]
5 use std::collections::HashMap;
9 let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
10 buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough
12 // but it is ok if we use a temporary
14 buggy_map.insert(43, &*tmp);