]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/slow_vector_initialization.stderr
New upstream version 1.73.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / slow_vector_initialization.stderr
CommitLineData
f20569fa 1error: slow zero-filling initialization
add651ee 2 --> $DIR/slow_vector_initialization.rs:14:5
f20569fa
XL
3 |
4LL | let mut vec1 = Vec::with_capacity(len);
add651ee 5 | ----------------------- help: consider replacing this with: `vec![0; len]`
f20569fa
XL
6LL | vec1.extend(repeat(0).take(len));
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 = note: `-D clippy::slow-vector-initialization` implied by `-D warnings`
10
11error: slow zero-filling initialization
add651ee 12 --> $DIR/slow_vector_initialization.rs:18:5
f20569fa
XL
13 |
14LL | let mut vec2 = Vec::with_capacity(len - 10);
add651ee 15 | ---------------------------- help: consider replacing this with: `vec![0; len - 10]`
f20569fa
XL
16LL | vec2.extend(repeat(0).take(len - 10));
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19error: slow zero-filling initialization
add651ee 20 --> $DIR/slow_vector_initialization.rs:25:5
064997fb
FG
21 |
22LL | let mut vec4 = Vec::with_capacity(len);
add651ee 23 | ----------------------- help: consider replacing this with: `vec![0; len]`
064997fb
FG
24LL | vec4.extend(repeat(0).take(vec4.capacity()));
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27error: slow zero-filling initialization
add651ee 28 --> $DIR/slow_vector_initialization.rs:35:5
f20569fa
XL
29 |
30LL | let mut resized_vec = Vec::with_capacity(30);
add651ee 31 | ---------------------- help: consider replacing this with: `vec![0; 30]`
f20569fa
XL
32LL | resized_vec.resize(30, 0);
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
34
35error: slow zero-filling initialization
add651ee 36 --> $DIR/slow_vector_initialization.rs:38:5
f20569fa
XL
37 |
38LL | let mut extend_vec = Vec::with_capacity(30);
add651ee 39 | ---------------------- help: consider replacing this with: `vec![0; 30]`
f20569fa
XL
40LL | extend_vec.extend(repeat(0).take(30));
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43error: slow zero-filling initialization
add651ee 44 --> $DIR/slow_vector_initialization.rs:45:5
f20569fa
XL
45 |
46LL | let mut vec1 = Vec::with_capacity(len);
add651ee 47 | ----------------------- help: consider replacing this with: `vec![0; len]`
f20569fa
XL
48LL | vec1.resize(len, 0);
49 | ^^^^^^^^^^^^^^^^^^^
50
51error: slow zero-filling initialization
add651ee 52 --> $DIR/slow_vector_initialization.rs:53:5
f20569fa
XL
53 |
54LL | let mut vec3 = Vec::with_capacity(len - 10);
add651ee 55 | ---------------------------- help: consider replacing this with: `vec![0; len - 10]`
f20569fa
XL
56LL | vec3.resize(len - 10, 0);
57 | ^^^^^^^^^^^^^^^^^^^^^^^^
58
59error: slow zero-filling initialization
add651ee 60 --> $DIR/slow_vector_initialization.rs:56:5
064997fb
FG
61 |
62LL | let mut vec4 = Vec::with_capacity(len);
add651ee 63 | ----------------------- help: consider replacing this with: `vec![0; len]`
064997fb
FG
64LL | vec4.resize(vec4.capacity(), 0);
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67error: slow zero-filling initialization
add651ee 68 --> $DIR/slow_vector_initialization.rs:60:5
f20569fa
XL
69 |
70LL | vec1 = Vec::with_capacity(10);
add651ee 71 | ---------------------- help: consider replacing this with: `vec![0; 10]`
f20569fa
XL
72LL | vec1.resize(10, 0);
73 | ^^^^^^^^^^^^^^^^^^
74
add651ee
FG
75error: slow zero-filling initialization
76 --> $DIR/slow_vector_initialization.rs:67:5
77 |
78LL | let mut vec1 = Vec::new();
79 | ---------- help: consider replacing this with: `vec![0; len]`
80LL | vec1.resize(len, 0);
81 | ^^^^^^^^^^^^^^^^^^^
82
83error: slow zero-filling initialization
84 --> $DIR/slow_vector_initialization.rs:71:5
85 |
86LL | let mut vec3 = Vec::new();
87 | ---------- help: consider replacing this with: `vec![0; len - 10]`
88LL | vec3.resize(len - 10, 0);
89 | ^^^^^^^^^^^^^^^^^^^^^^^^
90
91error: slow zero-filling initialization
92 --> $DIR/slow_vector_initialization.rs:75:5
93 |
94LL | vec1 = Vec::new();
95 | ---------- help: consider replacing this with: `vec![0; 10]`
96LL | vec1.resize(10, 0);
97 | ^^^^^^^^^^^^^^^^^^
98
99error: aborting due to 12 previous errors
f20569fa 100