2021-01-15 03:56:44 -06:00
|
|
|
error: calls to `push` immediately after creation
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:5:5
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | / let mut def_err: Vec<u32> = Default::default();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
|
|
|
LL | |
|
2021-01-15 03:56:44 -06:00
|
|
|
LL | | def_err.push(0);
|
2022-05-21 06:24:00 -05:00
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::vec-init-then-push` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::vec_init_then_push)]`
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:10:5
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | / let mut new_err = Vec::<u32>::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2021-01-15 03:56:44 -06:00
|
|
|
LL | | new_err.push(1);
|
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `let mut new_err = vec![..];`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:14:5
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | / let mut cap_err = Vec::with_capacity(2);
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2021-01-15 03:56:44 -06:00
|
|
|
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
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:27:5
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | / new_err = Vec::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2021-01-15 03:56:44 -06:00
|
|
|
LL | | new_err.push(0);
|
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `new_err = vec![..];`
|
|
|
|
|
2022-05-21 06:24:00 -05:00
|
|
|
error: calls to `push` immediately after creation
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:78:5
|
2022-05-21 06:24:00 -05:00
|
|
|
|
|
|
|
|
LL | / let mut v = Vec::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2022-05-21 06:24:00 -05:00
|
|
|
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
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:87:5
|
2022-05-21 06:24:00 -05:00
|
|
|
|
|
|
|
|
LL | / let mut v = Vec::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2022-05-21 06:24:00 -05:00
|
|
|
LL | | v.push(0);
|
|
|
|
LL | | v.push(1);
|
|
|
|
... |
|
|
|
|
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
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:101:5
|
2022-05-21 06:24:00 -05:00
|
|
|
|
|
|
|
|
LL | / let mut v2 = Vec::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2022-05-21 06:24:00 -05:00
|
|
|
LL | | v2.push(0);
|
|
|
|
LL | | v2.push(1);
|
|
|
|
... |
|
|
|
|
LL | | v2.push(1);
|
|
|
|
LL | | v2.push(0);
|
|
|
|
| |_______________^ help: consider using the `vec![]` macro: `let mut v2 = vec![..];`
|
|
|
|
|
2022-09-09 06:36:26 -05:00
|
|
|
error: calls to `push` immediately after creation
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/vec_init_then_push.rs:117:5
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | / let mut v = Vec::new();
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2022-09-09 06:36:26 -05:00
|
|
|
LL | | v.push((0i32, 0i32));
|
|
|
|
| |_________________________^ help: consider using the `vec![]` macro: `let v = vec![..];`
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2021-01-15 03:56:44 -06:00
|
|
|
|