]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: calls to `push` immediately after creation |
c620b35d | 2 | --> tests/ui/vec_init_then_push.rs:5:5 |
f20569fa XL |
3 | | |
4 | LL | / let mut def_err: Vec<u32> = Default::default(); | |
781aab86 FG |
5 | LL | | |
6 | LL | | | |
f20569fa | 7 | LL | | def_err.push(0); |
923072b8 | 8 | | |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];` |
f20569fa XL |
9 | | |
10 | = note: `-D clippy::vec-init-then-push` implied by `-D warnings` | |
781aab86 | 11 | = help: to override `-D warnings` add `#[allow(clippy::vec_init_then_push)]` |
f20569fa XL |
12 | |
13 | error: calls to `push` immediately after creation | |
c620b35d | 14 | --> tests/ui/vec_init_then_push.rs:10:5 |
f20569fa XL |
15 | | |
16 | LL | / let mut new_err = Vec::<u32>::new(); | |
781aab86 | 17 | LL | | |
f20569fa XL |
18 | LL | | new_err.push(1); |
19 | | |____________________^ help: consider using the `vec![]` macro: `let mut new_err = vec![..];` | |
20 | ||
21 | error: calls to `push` immediately after creation | |
c620b35d | 22 | --> tests/ui/vec_init_then_push.rs:14:5 |
f20569fa XL |
23 | | |
24 | LL | / let mut cap_err = Vec::with_capacity(2); | |
781aab86 | 25 | LL | | |
f20569fa XL |
26 | LL | | cap_err.push(0); |
27 | LL | | cap_err.push(1); | |
28 | LL | | cap_err.push(2); | |
29 | | |____________________^ help: consider using the `vec![]` macro: `let mut cap_err = vec![..];` | |
30 | ||
31 | error: calls to `push` immediately after creation | |
c620b35d | 32 | --> tests/ui/vec_init_then_push.rs:27:5 |
f20569fa XL |
33 | | |
34 | LL | / new_err = Vec::new(); | |
781aab86 | 35 | LL | | |
f20569fa XL |
36 | LL | | new_err.push(0); |
37 | | |____________________^ help: consider using the `vec![]` macro: `new_err = vec![..];` | |
38 | ||
923072b8 | 39 | error: calls to `push` immediately after creation |
c620b35d | 40 | --> tests/ui/vec_init_then_push.rs:78:5 |
923072b8 FG |
41 | | |
42 | LL | / let mut v = Vec::new(); | |
781aab86 | 43 | LL | | |
923072b8 FG |
44 | LL | | v.push(x); |
45 | LL | | v.push(1); | |
46 | | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];` | |
47 | ||
48 | error: calls to `push` immediately after creation | |
c620b35d | 49 | --> tests/ui/vec_init_then_push.rs:87:5 |
923072b8 FG |
50 | | |
51 | LL | / let mut v = Vec::new(); | |
781aab86 | 52 | LL | | |
923072b8 FG |
53 | LL | | v.push(0); |
54 | LL | | v.push(1); | |
923072b8 FG |
55 | ... | |
56 | LL | | v.push(1); | |
57 | LL | | v.push(0); | |
58 | | |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];` | |
59 | ||
60 | error: calls to `push` immediately after creation | |
c620b35d | 61 | --> tests/ui/vec_init_then_push.rs:101:5 |
923072b8 FG |
62 | | |
63 | LL | / let mut v2 = Vec::new(); | |
781aab86 | 64 | LL | | |
923072b8 FG |
65 | LL | | v2.push(0); |
66 | LL | | v2.push(1); | |
923072b8 FG |
67 | ... | |
68 | LL | | v2.push(1); | |
69 | LL | | v2.push(0); | |
70 | | |_______________^ help: consider using the `vec![]` macro: `let mut v2 = vec![..];` | |
71 | ||
064997fb | 72 | error: calls to `push` immediately after creation |
c620b35d | 73 | --> tests/ui/vec_init_then_push.rs:117:5 |
064997fb FG |
74 | | |
75 | LL | / let mut v = Vec::new(); | |
781aab86 | 76 | LL | | |
064997fb FG |
77 | LL | | v.push((0i32, 0i32)); |
78 | | |_________________________^ help: consider using the `vec![]` macro: `let v = vec![..];` | |
79 | ||
80 | error: aborting due to 8 previous errors | |
f20569fa | 81 |