1
1
error: 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
3
15
|
4
16
LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
5
17
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,11 +20,9 @@ LL | vec.set_len(200);
8
20
| ^^^^^^^^^^^^^^^^
9
21
|
10
22
= 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)]`
13
23
14
24
error: 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
16
26
|
17
27
LL | vec.reserve(1000);
18
28
| ^^^^^^^^^^^^^^^^^^
@@ -23,7 +33,7 @@ LL | vec.set_len(200);
23
33
= help: initialize the buffer or wrap the content in `MaybeUninit`
24
34
25
35
error: 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
27
37
|
28
38
LL | let mut vec: Vec<u8> = Vec::new();
29
39
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +42,7 @@ LL | vec.set_len(200);
32
42
| ^^^^^^^^^^^^^^^^
33
43
34
44
error: 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
36
46
|
37
47
LL | let mut vec: Vec<u8> = Default::default();
38
48
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +51,7 @@ LL | vec.set_len(200);
41
51
| ^^^^^^^^^^^^^^^^
42
52
43
53
error: 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
45
55
|
46
56
LL | let mut vec: Vec<u8> = Vec::default();
47
57
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +60,7 @@ LL | vec.set_len(200);
50
60
| ^^^^^^^^^^^^^^^^
51
61
52
62
error: 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
54
64
|
55
65
LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
56
66
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +71,7 @@ LL | vec.set_len(200);
61
71
= help: initialize the buffer or wrap the content in `MaybeUninit`
62
72
63
73
error: 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
65
75
|
66
76
LL | my_vec.vec.reserve(1000);
67
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -72,7 +82,7 @@ LL | my_vec.vec.set_len(200);
72
82
= help: initialize the buffer or wrap the content in `MaybeUninit`
73
83
74
84
error: 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
76
86
|
77
87
LL | my_vec.vec = Vec::with_capacity(1000);
78
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -83,7 +93,7 @@ LL | my_vec.vec.set_len(200);
83
93
= help: initialize the buffer or wrap the content in `MaybeUninit`
84
94
85
95
error: 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
87
97
|
88
98
LL | let mut vec: Vec<u8> = Vec::with_capacity(1000);
89
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -94,7 +104,7 @@ LL | vec.set_len(200);
94
104
= help: initialize the buffer or wrap the content in `MaybeUninit`
95
105
96
106
error: 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
98
108
|
99
109
LL | vec.reserve(1000);
100
110
| ^^^^^^^^^^^^^^^^^^
@@ -105,7 +115,7 @@ LL | vec.set_len(200);
105
115
= help: initialize the buffer or wrap the content in `MaybeUninit`
106
116
107
117
error: 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
109
119
|
110
120
LL | let mut vec: Vec<T> = Vec::with_capacity(1000);
111
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -115,5 +125,5 @@ LL | vec.set_len(10);
115
125
|
116
126
= help: initialize the buffer or wrap the content in `MaybeUninit`
117
127
118
- error: aborting due to 11 previous errors
128
+ error: aborting due to 12 previous errors
119
129
0 commit comments