11error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
2- --> tests/ui/uninit_vec.rs:17:5
2+ --> tests/ui/uninit_vec.rs:18:5
3+ |
4+ LL | let mut vec = Vec::<UnsafeCell<*mut S>>::with_capacity(1);
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+ LL | vec.set_len(1);
7+ | ^^^^^^^^^^^^^^
8+ |
9+ = help: initialize the buffer or wrap the content in `MaybeUninit`
10+ = note: `-D clippy::uninit-vec` implied by `-D warnings`
11+ = help: to override `-D warnings` add `#[allow(clippy::uninit_vec)]`
12+
13+ error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
14+ --> tests/ui/uninit_vec.rs:24:5
315 |
416LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
517 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,11 +20,9 @@ LL | vec.set_len(200);
820 | ^^^^^^^^^^^^^^^^
921 |
1022 = help: initialize the buffer or wrap the content in `MaybeUninit`
11- = note: `-D clippy::uninit-vec` implied by `-D warnings`
12- = help: to override `-D warnings` add `#[allow(clippy::uninit_vec)]`
1323
1424error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
15- --> tests/ui/uninit_vec.rs:24 :5
25+ --> tests/ui/uninit_vec.rs:31 :5
1626 |
1727LL | vec.reserve(1000);
1828 | ^^^^^^^^^^^^^^^^^^
@@ -23,7 +33,7 @@ LL | vec.set_len(200);
2333 = help: initialize the buffer or wrap the content in `MaybeUninit`
2434
2535error: calling `set_len()` on empty `Vec` creates out-of-bound values
26- --> tests/ui/uninit_vec.rs:31 :5
36+ --> tests/ui/uninit_vec.rs:38 :5
2737 |
2838LL | let mut vec: Vec<u8> = Vec::new();
2939 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +42,7 @@ LL | vec.set_len(200);
3242 | ^^^^^^^^^^^^^^^^
3343
3444error: calling `set_len()` on empty `Vec` creates out-of-bound values
35- --> tests/ui/uninit_vec.rs:38 :5
45+ --> tests/ui/uninit_vec.rs:45 :5
3646 |
3747LL | let mut vec: Vec<u8> = Default::default();
3848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +51,7 @@ LL | vec.set_len(200);
4151 | ^^^^^^^^^^^^^^^^
4252
4353error: calling `set_len()` on empty `Vec` creates out-of-bound values
44- --> tests/ui/uninit_vec.rs:44 :5
54+ --> tests/ui/uninit_vec.rs:51 :5
4555 |
4656LL | let mut vec: Vec<u8> = Vec::default();
4757 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +60,7 @@ LL | vec.set_len(200);
5060 | ^^^^^^^^^^^^^^^^
5161
5262error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
53- --> tests/ui/uninit_vec.rs:61 :5
63+ --> tests/ui/uninit_vec.rs:68 :5
5464 |
5565LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
5666 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +71,7 @@ LL | vec.set_len(200);
6171 = help: initialize the buffer or wrap the content in `MaybeUninit`
6272
6373error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
64- --> tests/ui/uninit_vec.rs:71 :5
74+ --> tests/ui/uninit_vec.rs:78 :5
6575 |
6676LL | my_vec.vec.reserve(1000);
6777 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -72,7 +82,7 @@ LL | my_vec.vec.set_len(200);
7282 = help: initialize the buffer or wrap the content in `MaybeUninit`
7383
7484error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
75- --> tests/ui/uninit_vec.rs:77 :5
85+ --> tests/ui/uninit_vec.rs:84 :5
7686 |
7787LL | my_vec.vec = Vec::with_capacity(1000);
7888 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -83,7 +93,7 @@ LL | my_vec.vec.set_len(200);
8393 = help: initialize the buffer or wrap the content in `MaybeUninit`
8494
8595error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
86- --> tests/ui/uninit_vec.rs:52 :9
96+ --> tests/ui/uninit_vec.rs:59 :9
8797 |
8898LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
8999 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,7 +104,7 @@ LL | vec.set_len(200);
94104 = help: initialize the buffer or wrap the content in `MaybeUninit`
95105
96106error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
97- --> tests/ui/uninit_vec.rs:56 :9
107+ --> tests/ui/uninit_vec.rs:63 :9
98108 |
99109LL | vec.reserve(1000);
100110 | ^^^^^^^^^^^^^^^^^^
@@ -105,7 +115,7 @@ LL | vec.set_len(200);
105115 = help: initialize the buffer or wrap the content in `MaybeUninit`
106116
107117error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
108- --> tests/ui/uninit_vec.rs:132 :9
118+ --> tests/ui/uninit_vec.rs:139 :9
109119 |
110120LL | let mut vec: Vec<T> = Vec::with_capacity(1000);
111121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -115,5 +125,5 @@ LL | vec.set_len(10);
115125 |
116126 = help: initialize the buffer or wrap the content in `MaybeUninit`
117127
118- error: aborting due to 11 previous errors
128+ error: aborting due to 12 previous errors
119129
0 commit comments