1 #![warn(clippy::box_default)]
4 struct ImplementsDefault;
21 let _string: Box<String> = Box::new(Default::default());
22 let _byte = Box::new(u8::default());
23 let _vec = Box::new(Vec::<u8>::new());
24 let _impl = Box::new(ImplementsDefault::default());
25 let _impl2 = Box::new(<ImplementsDefault as Default>::default());
26 let _impl3: Box<ImplementsDefault> = Box::new(Default::default());
27 let _own = Box::new(OwnDefault::default()); // should not lint
28 let _in_macro = outer!(Box::new(String::new()));
29 // false negative: default is from different expansion
30 let _vec2: Box<Vec<ImplementsDefault>> = Box::new(vec![]);