]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | #![warn(clippy::all)] |
2 | #![allow(clippy::boxed_local, clippy::needless_pass_by_value)] | |
3 | #![allow(clippy::blacklisted_name)] | |
4 | ||
5 | macro_rules! boxit { | |
6 | ($init:expr, $x:ty) => { | |
7 | let _: Box<$x> = Box::new($init); | |
8 | }; | |
9 | } | |
10 | ||
11 | fn test_macro() { | |
12 | boxit!(Vec::new(), Vec<u8>); | |
13 | } | |
14 | pub fn test(foo: Box<Vec<bool>>) { | |
15 | println!("{:?}", foo.get(0)) | |
16 | } | |
17 | ||
18 | pub fn test2(foo: Box<dyn Fn(Vec<u32>)>) { | |
19 | // pass if #31 is fixed | |
20 | foo(vec![1, 2, 3]) | |
21 | } | |
22 | ||
23 | pub fn test_local_not_linted() { | |
24 | let _: Box<Vec<bool>>; | |
25 | } | |
26 | ||
27 | fn main() { | |
28 | test(Box::new(Vec::new())); | |
29 | test2(Box::new(|v| println!("{:?}", v))); | |
30 | test_macro(); | |
31 | test_local_not_linted(); | |
32 | } |