]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/uninit_vec.stderr
Rollup merge of #102072 - scottmcm:ptr-alignment-type, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / uninit_vec.stderr
1 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
2   --> $DIR/uninit_vec.rs:12:5
3    |
4 LL |     let mut vec: Vec<u8> = Vec::with_capacity(1000);
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 LL |     unsafe {
7 LL |         vec.set_len(200);
8    |         ^^^^^^^^^^^^^^^^
9    |
10    = help: initialize the buffer or wrap the content in `MaybeUninit`
11    = note: `-D clippy::uninit-vec` implied by `-D warnings`
12
13 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
14   --> $DIR/uninit_vec.rs:18:5
15    |
16 LL |     vec.reserve(1000);
17    |     ^^^^^^^^^^^^^^^^^^
18 LL |     unsafe {
19 LL |         vec.set_len(200);
20    |         ^^^^^^^^^^^^^^^^
21    |
22    = help: initialize the buffer or wrap the content in `MaybeUninit`
23
24 error: calling `set_len()` on empty `Vec` creates out-of-bound values
25   --> $DIR/uninit_vec.rs:24:5
26    |
27 LL |     let mut vec: Vec<u8> = Vec::new();
28    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 LL |     unsafe {
30 LL |         vec.set_len(200);
31    |         ^^^^^^^^^^^^^^^^
32
33 error: calling `set_len()` on empty `Vec` creates out-of-bound values
34   --> $DIR/uninit_vec.rs:30:5
35    |
36 LL |     let mut vec: Vec<u8> = Default::default();
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 LL |     unsafe {
39 LL |         vec.set_len(200);
40    |         ^^^^^^^^^^^^^^^^
41
42 error: calling `set_len()` on empty `Vec` creates out-of-bound values
43   --> $DIR/uninit_vec.rs:35:5
44    |
45 LL |     let mut vec: Vec<u8> = Vec::default();
46    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 LL |     unsafe {
48 LL |         vec.set_len(200);
49    |         ^^^^^^^^^^^^^^^^
50
51 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
52   --> $DIR/uninit_vec.rs:49:5
53    |
54 LL |     let mut vec: Vec<u8> = Vec::with_capacity(1000);
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 ...
57 LL |         vec.set_len(200);
58    |         ^^^^^^^^^^^^^^^^
59    |
60    = help: initialize the buffer or wrap the content in `MaybeUninit`
61
62 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
63   --> $DIR/uninit_vec.rs:58:5
64    |
65 LL |     my_vec.vec.reserve(1000);
66    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
67 LL |     unsafe {
68 LL |         my_vec.vec.set_len(200);
69    |         ^^^^^^^^^^^^^^^^^^^^^^^
70    |
71    = help: initialize the buffer or wrap the content in `MaybeUninit`
72
73 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
74   --> $DIR/uninit_vec.rs:63:5
75    |
76 LL |     my_vec.vec = Vec::with_capacity(1000);
77    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 LL |     unsafe {
79 LL |         my_vec.vec.set_len(200);
80    |         ^^^^^^^^^^^^^^^^^^^^^^^
81    |
82    = help: initialize the buffer or wrap the content in `MaybeUninit`
83
84 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
85   --> $DIR/uninit_vec.rs:42:9
86    |
87 LL |         let mut vec: Vec<u8> = Vec::with_capacity(1000);
88    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89 LL |         vec.set_len(200);
90    |         ^^^^^^^^^^^^^^^^
91    |
92    = help: initialize the buffer or wrap the content in `MaybeUninit`
93
94 error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
95   --> $DIR/uninit_vec.rs:45:9
96    |
97 LL |         vec.reserve(1000);
98    |         ^^^^^^^^^^^^^^^^^^
99 LL |         vec.set_len(200);
100    |         ^^^^^^^^^^^^^^^^
101    |
102    = help: initialize the buffer or wrap the content in `MaybeUninit`
103
104 error: aborting due to 10 previous errors
105