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