1 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
2 --> $DIR/uninit_vec.rs:12:5
4 LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 = note: `-D clippy::uninit-vec` implied by `-D warnings`
11 = help: initialize the buffer or wrap the content in `MaybeUninit`
13 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
14 --> $DIR/uninit_vec.rs:18:5
16 LL | vec.reserve(1000);
19 LL | vec.set_len(200);
22 = help: initialize the buffer or wrap the content in `MaybeUninit`
24 error: calling `set_len()` on empty `Vec` creates out-of-bound values
25 --> $DIR/uninit_vec.rs:24:5
27 LL | let mut vec: Vec<u8> = Vec::new();
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 LL | vec.set_len(200);
33 error: calling `set_len()` on empty `Vec` creates out-of-bound values
34 --> $DIR/uninit_vec.rs:30:5
36 LL | let mut vec: Vec<u8> = Default::default();
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 LL | vec.set_len(200);
42 error: calling `set_len()` on empty `Vec` creates out-of-bound values
43 --> $DIR/uninit_vec.rs:35:5
45 LL | let mut vec: Vec<u8> = Vec::default();
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 LL | vec.set_len(200);
51 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
52 --> $DIR/uninit_vec.rs:49:5
54 LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 LL | vec.set_len(200);
60 = help: initialize the buffer or wrap the content in `MaybeUninit`
62 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
63 --> $DIR/uninit_vec.rs:58:5
65 LL | my_vec.vec.reserve(1000);
66 | ^^^^^^^^^^^^^^^^^^^^^^^^^
68 LL | my_vec.vec.set_len(200);
69 | ^^^^^^^^^^^^^^^^^^^^^^^
71 = help: initialize the buffer or wrap the content in `MaybeUninit`
73 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
74 --> $DIR/uninit_vec.rs:63:5
76 LL | my_vec.vec = Vec::with_capacity(1000);
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79 LL | my_vec.vec.set_len(200);
80 | ^^^^^^^^^^^^^^^^^^^^^^^
82 = help: initialize the buffer or wrap the content in `MaybeUninit`
84 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
85 --> $DIR/uninit_vec.rs:42:9
87 LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
88 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89 LL | vec.set_len(200);
92 = help: initialize the buffer or wrap the content in `MaybeUninit`
94 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
95 --> $DIR/uninit_vec.rs:45:9
97 LL | vec.reserve(1000);
99 LL | vec.set_len(200);
102 = help: initialize the buffer or wrap the content in `MaybeUninit`
104 error: aborting due to 10 previous errors