2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-01-28 19:22:55 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:14:20
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec1 = Vec::with_capacity(len);
|
|
|
|
|
| ____________________^
|
|
|
|
|
... |
|
|
|
|
|
LL | | vec1.extend(repeat(0).take(len));
|
|
|
|
|
| |____________________________________^ help: consider replacing this with: `vec![0; len]`
|
2018-10-30 00:25:05 +01:00
|
|
|
|
|
|
|
|
|
= note: `-D clippy::slow-vector-initialization` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::slow_vector_initialization)]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-01-28 19:22:55 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:20:20
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec2 = Vec::with_capacity(len - 10);
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec2.extend(repeat(0).take(len - 10));
|
|
|
|
|
| |_________________________________________^ help: consider replacing this with: `vec![0; len - 10]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:29:20
|
2022-06-30 10:50:09 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec4 = Vec::with_capacity(len);
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec4.extend(repeat(0).take(vec4.capacity()));
|
|
|
|
|
| |________________________________________________^ help: consider replacing this with: `vec![0; len]`
|
2022-06-30 10:50:09 +02:00
|
|
|
|
|
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:41:27
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut resized_vec = Vec::with_capacity(30);
|
|
|
|
|
| ___________________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | resized_vec.resize(30, 0);
|
|
|
|
|
| |_____________________________^ help: consider replacing this with: `vec![0; 30]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:46:26
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut extend_vec = Vec::with_capacity(30);
|
|
|
|
|
| __________________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | extend_vec.extend(repeat(0).take(30));
|
|
|
|
|
| |_________________________________________^ help: consider replacing this with: `vec![0; 30]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:55:20
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec1 = Vec::with_capacity(len);
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec1.resize(len, 0);
|
|
|
|
|
| |_______________________^ help: consider replacing this with: `vec![0; len]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:65:20
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec3 = Vec::with_capacity(len - 10);
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec3.resize(len - 10, 0);
|
|
|
|
|
| |____________________________^ help: consider replacing this with: `vec![0; len - 10]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2018-10-30 21:47:15 +01:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:70:20
|
2022-06-30 10:50:09 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec4 = Vec::with_capacity(len);
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec4.resize(vec4.capacity(), 0);
|
|
|
|
|
| |___________________________________^ help: consider replacing this with: `vec![0; len]`
|
2022-06-30 10:50:09 +02:00
|
|
|
|
|
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:76:12
|
2018-10-19 01:15:48 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | vec1 = Vec::with_capacity(10);
|
|
|
|
|
| ____________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec1.resize(10, 0);
|
|
|
|
|
| |______________________^ help: consider replacing this with: `vec![0; 10]`
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:85:20
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec1 = Vec::new();
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec1.resize(len, 0);
|
|
|
|
|
| |_______________________^ help: consider replacing this with: `vec![0; len]`
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:91:20
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | let mut vec3 = Vec::new();
|
|
|
|
|
| ____________________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec3.resize(len - 10, 0);
|
|
|
|
|
| |____________________________^ help: consider replacing this with: `vec![0; len - 10]`
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:97:12
|
2023-07-31 23:53:53 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | vec1 = Vec::new();
|
|
|
|
|
| ____________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec1.resize(10, 0);
|
|
|
|
|
| |______________________^ help: consider replacing this with: `vec![0; 10]`
|
2018-10-19 01:15:48 +02:00
|
|
|
|
2023-09-12 18:13:53 +02:00
|
|
|
error: slow zero-filling initialization
|
2025-02-28 23:20:48 +01:00
|
|
|
--> tests/ui/slow_vector_initialization.rs:102:12
|
2023-09-12 18:13:53 +02:00
|
|
|
|
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | vec1 = vec![];
|
|
|
|
|
| ____________^
|
2025-02-28 23:20:48 +01:00
|
|
|
... |
|
2025-01-09 18:57:00 +01:00
|
|
|
LL | | vec1.resize(10, 0);
|
|
|
|
|
| |______________________^ help: consider replacing this with: `vec![0; 10]`
|
2023-09-12 18:13:53 +02:00
|
|
|
|
2023-10-06 17:35:45 +02:00
|
|
|
error: aborting due to 13 previous errors
|
2018-10-19 01:15:48 +02:00
|
|
|
|