2 #![allow(clippy::boxed_local, clippy::needless_pass_by_value, clippy::disallowed_name, unused)]
4 use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque};
7 ($init:expr, $x:ty) => {
8 let _: Box<$x> = Box::new($init);
13 boxit!(Vec::new(), Vec<u8>);
16 fn test1(foo: Box<Vec<bool>>) {}
18 fn test2(foo: Box<dyn Fn(Vec<u32>)>) {
19 // pass if #31 is fixed
23 fn test3(foo: Box<String>) {}
25 fn test4(foo: Box<HashMap<String, String>>) {}
27 fn test5(foo: Box<HashSet<i64>>) {}
29 fn test6(foo: Box<VecDeque<i32>>) {}
31 fn test7(foo: Box<LinkedList<i16>>) {}
33 fn test8(foo: Box<BTreeMap<i8, String>>) {}
35 fn test9(foo: Box<BTreeSet<u64>>) {}
37 fn test10(foo: Box<BinaryHeap<u32>>) {}
39 fn test_local_not_linted() {
40 let _: Box<Vec<bool>>;
43 // All of these test should be allowed because they are part of the
44 // public api and `avoid_breaking_exported_api` is `false` by default.
45 pub fn pub_test(foo: Box<Vec<bool>>) {}
47 pub fn pub_test_ret() -> Box<Vec<bool>> {