4 clippy
::needless_pass_by_value
,
5 clippy
::disallowed_names
,
9 use std
::collections
::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque}
;
12 ($init
:expr
, $x
:ty
) => {
13 let _
: Box
<$x
> = Box
::new($init
);
18 boxit
!(vec
![1], Vec
<u8>);
21 fn test1(foo
: Box
<Vec
<bool
>>) {}
22 //~^ ERROR: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>`
24 fn test2(foo
: Box
<dyn Fn(Vec
<u32>)>) {
25 // pass if #31 is fixed
29 fn test3(foo
: Box
<String
>) {}
30 //~^ ERROR: you seem to be trying to use `Box<String>`. Consider using just `String`
32 fn test4(foo
: Box
<HashMap
<String
, String
>>) {}
33 //~^ ERROR: you seem to be trying to use `Box<HashMap<..>>`. Consider using just `HashMap<
35 fn test5(foo
: Box
<HashSet
<i64>>) {}
36 //~^ ERROR: you seem to be trying to use `Box<HashSet<..>>`. Consider using just `HashSet<
38 fn test6(foo
: Box
<VecDeque
<i32>>) {}
39 //~^ ERROR: you seem to be trying to use `Box<VecDeque<..>>`. Consider using just `VecDequ
41 fn test7(foo
: Box
<LinkedList
<i16>>) {}
42 //~^ ERROR: you seem to be trying to use `Box<LinkedList<..>>`. Consider using just `Linke
44 fn test8(foo
: Box
<BTreeMap
<i8, String
>>) {}
45 //~^ ERROR: you seem to be trying to use `Box<BTreeMap<..>>`. Consider using just `BTreeMa
47 fn test9(foo
: Box
<BTreeSet
<u64>>) {}
48 //~^ ERROR: you seem to be trying to use `Box<BTreeSet<..>>`. Consider using just `BTreeSe
50 fn test10(foo
: Box
<BinaryHeap
<u32>>) {}
51 //~^ ERROR: you seem to be trying to use `Box<BinaryHeap<..>>`. Consider using just `Binar
53 fn test_local_not_linted() {
54 let _
: Box
<Vec
<bool
>>;
57 // All of these test should be allowed because they are part of the
58 // public api and `avoid_breaking_exported_api` is `false` by default.
59 pub fn pub_test(foo
: Box
<Vec
<bool
>>) {}
61 pub fn pub_test_ret() -> Box
<Vec
<bool
>> {