2018-10-18 18:15:48 -05:00
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:22:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
22 | let mut vec1 = Vec::with_capacity(len);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^-----------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::slow-vector-initialization` implied by `-D warnings`
|
2018-10-26 15:35:16 -05:00
|
|
|
note: extended at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:23:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
23 | vec1.extend(repeat(0).take(len));
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:26:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
26 | let mut vec2 = Vec::with_capacity(len - 10);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^----------------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: extended at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:27:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
27 | vec2.extend(repeat(0).take(len - 10));
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:39:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
39 | let mut resized_vec = Vec::with_capacity(30);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^----------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: resized at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:42:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
42 | resized_vec.resize(30, 0);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:40:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
40 | let mut extend_vec = Vec::with_capacity(30);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^----------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: extended at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:44:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
44 | extend_vec.extend(repeat(0).take(30));
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:50:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
50 | let mut vec1 = Vec::with_capacity(len);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^-----------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: resized at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:51:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
51 | vec1.resize(len, 0);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:58:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
58 | let mut vec3 = Vec::with_capacity(len - 10);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^----------------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: resized at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:59:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
59 | vec3.resize(len - 10, 0);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: detected slow zero-filling initialization
|
2018-10-26 15:35:16 -05:00
|
|
|
--> $DIR/slow_vector_initialization.rs:62:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
62 | vec1 = Vec::with_capacity(10);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^----------------------
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
note: resized at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:63:5
|
2018-10-18 18:15:48 -05:00
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
63 | vec1.resize(10, 0);
|
2018-10-18 18:15:48 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-10-26 15:35:16 -05:00
|
|
|
error: detected slow zero-filling initialization
|
|
|
|
--> $DIR/slow_vector_initialization.rs:67:5
|
|
|
|
|
|
|
|
|
67 | let mut unsafe_vec: Vec<u8> = Vec::with_capacity(200);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------^
|
|
|
|
| |
|
|
|
|
| help: consider replacing with: `vec![0; ..]`
|
|
|
|
|
|
|
|
|
note: changed len at
|
|
|
|
--> $DIR/slow_vector_initialization.rs:70:9
|
|
|
|
|
|
|
|
|
70 | unsafe_vec.set_len(200);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2018-10-18 18:15:48 -05:00
|
|
|
|