|
1 | 1 | error: the type `&'static T` does not permit zero-initialization
|
2 |
| - --> $DIR/uninitialized-zeroed.rs:20:32 |
| 2 | + --> $DIR/uninitialized-zeroed.rs:22:32 |
3 | 3 | |
|
4 | 4 | LL | let _val: &'static T = mem::zeroed();
|
5 | 5 | | ^^^^^^^^^^^^^
|
| 6 | + | | |
| 7 | + | this code causes undefined behavior when executed |
| 8 | + | help: use `MaybeUninit<T>` instead |
6 | 9 | |
|
7 | 10 | note: lint level defined here
|
8 | 11 | --> $DIR/uninitialized-zeroed.rs:7:9
|
9 | 12 | |
|
10 | 13 | LL | #![deny(invalid_value)]
|
11 | 14 | | ^^^^^^^^^^^^^
|
12 |
| - = note: this means that this code causes undefined behavior when executed |
13 |
| - = help: use `MaybeUninit` instead |
| 15 | + = note: References must be non-null |
14 | 16 |
|
15 | 17 | error: the type `&'static T` does not permit being left uninitialized
|
16 |
| - --> $DIR/uninitialized-zeroed.rs:21:32 |
| 18 | + --> $DIR/uninitialized-zeroed.rs:23:32 |
17 | 19 | |
|
18 | 20 | LL | let _val: &'static T = mem::uninitialized();
|
19 | 21 | | ^^^^^^^^^^^^^^^^^^^^
|
| 22 | + | | |
| 23 | + | this code causes undefined behavior when executed |
| 24 | + | help: use `MaybeUninit<T>` instead |
20 | 25 | |
|
21 |
| - = note: this means that this code causes undefined behavior when executed |
22 |
| - = help: use `MaybeUninit` instead |
| 26 | + = note: References must be non-null |
23 | 27 |
|
24 | 28 | error: the type `Wrap<&'static T>` does not permit zero-initialization
|
25 |
| - --> $DIR/uninitialized-zeroed.rs:23:38 |
| 29 | + --> $DIR/uninitialized-zeroed.rs:25:38 |
26 | 30 | |
|
27 | 31 | LL | let _val: Wrap<&'static T> = mem::zeroed();
|
28 | 32 | | ^^^^^^^^^^^^^
|
| 33 | + | | |
| 34 | + | this code causes undefined behavior when executed |
| 35 | + | help: use `MaybeUninit<T>` instead |
29 | 36 | |
|
30 |
| - = note: this means that this code causes undefined behavior when executed |
31 |
| - = help: use `MaybeUninit` instead |
| 37 | +note: References must be non-null (in this struct field) |
| 38 | + --> $DIR/uninitialized-zeroed.rs:16:18 |
| 39 | + | |
| 40 | +LL | struct Wrap<T> { wrapped: T } |
| 41 | + | ^^^^^^^^^^ |
32 | 42 |
|
33 | 43 | error: the type `Wrap<&'static T>` does not permit being left uninitialized
|
34 |
| - --> $DIR/uninitialized-zeroed.rs:24:38 |
| 44 | + --> $DIR/uninitialized-zeroed.rs:26:38 |
35 | 45 | |
|
36 | 46 | LL | let _val: Wrap<&'static T> = mem::uninitialized();
|
37 | 47 | | ^^^^^^^^^^^^^^^^^^^^
|
| 48 | + | | |
| 49 | + | this code causes undefined behavior when executed |
| 50 | + | help: use `MaybeUninit<T>` instead |
| 51 | + | |
| 52 | +note: References must be non-null (in this struct field) |
| 53 | + --> $DIR/uninitialized-zeroed.rs:16:18 |
38 | 54 | |
|
39 |
| - = note: this means that this code causes undefined behavior when executed |
40 |
| - = help: use `MaybeUninit` instead |
| 55 | +LL | struct Wrap<T> { wrapped: T } |
| 56 | + | ^^^^^^^^^^ |
41 | 57 |
|
42 | 58 | error: the type `!` does not permit zero-initialization
|
43 |
| - --> $DIR/uninitialized-zeroed.rs:30:23 |
| 59 | + --> $DIR/uninitialized-zeroed.rs:32:23 |
44 | 60 | |
|
45 | 61 | LL | let _val: ! = mem::zeroed();
|
46 | 62 | | ^^^^^^^^^^^^^
|
| 63 | + | | |
| 64 | + | this code causes undefined behavior when executed |
| 65 | + | help: use `MaybeUninit<T>` instead |
47 | 66 | |
|
48 |
| - = note: this means that this code causes undefined behavior when executed |
49 |
| - = help: use `MaybeUninit` instead |
| 67 | + = note: The never type (`!`) has no valid value |
50 | 68 |
|
51 | 69 | error: the type `!` does not permit being left uninitialized
|
52 |
| - --> $DIR/uninitialized-zeroed.rs:31:23 |
| 70 | + --> $DIR/uninitialized-zeroed.rs:33:23 |
53 | 71 | |
|
54 | 72 | LL | let _val: ! = mem::uninitialized();
|
55 | 73 | | ^^^^^^^^^^^^^^^^^^^^
|
| 74 | + | | |
| 75 | + | this code causes undefined behavior when executed |
| 76 | + | help: use `MaybeUninit<T>` instead |
56 | 77 | |
|
57 |
| - = note: this means that this code causes undefined behavior when executed |
58 |
| - = help: use `MaybeUninit` instead |
| 78 | + = note: The never type (`!`) has no valid value |
59 | 79 |
|
60 | 80 | error: the type `(i32, !)` does not permit zero-initialization
|
61 |
| - --> $DIR/uninitialized-zeroed.rs:33:30 |
| 81 | + --> $DIR/uninitialized-zeroed.rs:35:30 |
62 | 82 | |
|
63 | 83 | LL | let _val: (i32, !) = mem::zeroed();
|
64 | 84 | | ^^^^^^^^^^^^^
|
| 85 | + | | |
| 86 | + | this code causes undefined behavior when executed |
| 87 | + | help: use `MaybeUninit<T>` instead |
65 | 88 | |
|
66 |
| - = note: this means that this code causes undefined behavior when executed |
67 |
| - = help: use `MaybeUninit` instead |
| 89 | + = note: The never type (`!`) has no valid value |
68 | 90 |
|
69 | 91 | error: the type `(i32, !)` does not permit being left uninitialized
|
70 |
| - --> $DIR/uninitialized-zeroed.rs:34:30 |
| 92 | + --> $DIR/uninitialized-zeroed.rs:36:30 |
71 | 93 | |
|
72 | 94 | LL | let _val: (i32, !) = mem::uninitialized();
|
73 | 95 | | ^^^^^^^^^^^^^^^^^^^^
|
| 96 | + | | |
| 97 | + | this code causes undefined behavior when executed |
| 98 | + | help: use `MaybeUninit<T>` instead |
74 | 99 | |
|
75 |
| - = note: this means that this code causes undefined behavior when executed |
76 |
| - = help: use `MaybeUninit` instead |
| 100 | + = note: The never type (`!`) has no valid value |
77 | 101 |
|
78 | 102 | error: the type `Void` does not permit zero-initialization
|
79 |
| - --> $DIR/uninitialized-zeroed.rs:36:26 |
| 103 | + --> $DIR/uninitialized-zeroed.rs:38:26 |
80 | 104 | |
|
81 | 105 | LL | let _val: Void = mem::zeroed();
|
82 | 106 | | ^^^^^^^^^^^^^
|
| 107 | + | | |
| 108 | + | this code causes undefined behavior when executed |
| 109 | + | help: use `MaybeUninit<T>` instead |
83 | 110 | |
|
84 |
| - = note: this means that this code causes undefined behavior when executed |
85 |
| - = help: use `MaybeUninit` instead |
| 111 | + = note: 0-variant enums have no valid value |
86 | 112 |
|
87 | 113 | error: the type `Void` does not permit being left uninitialized
|
88 |
| - --> $DIR/uninitialized-zeroed.rs:37:26 |
| 114 | + --> $DIR/uninitialized-zeroed.rs:39:26 |
89 | 115 | |
|
90 | 116 | LL | let _val: Void = mem::uninitialized();
|
91 | 117 | | ^^^^^^^^^^^^^^^^^^^^
|
| 118 | + | | |
| 119 | + | this code causes undefined behavior when executed |
| 120 | + | help: use `MaybeUninit<T>` instead |
92 | 121 | |
|
93 |
| - = note: this means that this code causes undefined behavior when executed |
94 |
| - = help: use `MaybeUninit` instead |
| 122 | + = note: 0-variant enums have no valid value |
95 | 123 |
|
96 | 124 | error: the type `&'static i32` does not permit zero-initialization
|
97 |
| - --> $DIR/uninitialized-zeroed.rs:39:34 |
| 125 | + --> $DIR/uninitialized-zeroed.rs:41:34 |
98 | 126 | |
|
99 | 127 | LL | let _val: &'static i32 = mem::zeroed();
|
100 | 128 | | ^^^^^^^^^^^^^
|
| 129 | + | | |
| 130 | + | this code causes undefined behavior when executed |
| 131 | + | help: use `MaybeUninit<T>` instead |
101 | 132 | |
|
102 |
| - = note: this means that this code causes undefined behavior when executed |
103 |
| - = help: use `MaybeUninit` instead |
| 133 | + = note: References must be non-null |
104 | 134 |
|
105 | 135 | error: the type `&'static i32` does not permit being left uninitialized
|
106 |
| - --> $DIR/uninitialized-zeroed.rs:40:34 |
| 136 | + --> $DIR/uninitialized-zeroed.rs:42:34 |
107 | 137 | |
|
108 | 138 | LL | let _val: &'static i32 = mem::uninitialized();
|
109 | 139 | | ^^^^^^^^^^^^^^^^^^^^
|
| 140 | + | | |
| 141 | + | this code causes undefined behavior when executed |
| 142 | + | help: use `MaybeUninit<T>` instead |
110 | 143 | |
|
111 |
| - = note: this means that this code causes undefined behavior when executed |
112 |
| - = help: use `MaybeUninit` instead |
| 144 | + = note: References must be non-null |
113 | 145 |
|
114 | 146 | error: the type `Ref` does not permit zero-initialization
|
115 |
| - --> $DIR/uninitialized-zeroed.rs:42:25 |
| 147 | + --> $DIR/uninitialized-zeroed.rs:44:25 |
116 | 148 | |
|
117 | 149 | LL | let _val: Ref = mem::zeroed();
|
118 | 150 | | ^^^^^^^^^^^^^
|
| 151 | + | | |
| 152 | + | this code causes undefined behavior when executed |
| 153 | + | help: use `MaybeUninit<T>` instead |
| 154 | + | |
| 155 | +note: References must be non-null (in this struct field) |
| 156 | + --> $DIR/uninitialized-zeroed.rs:13:12 |
119 | 157 | |
|
120 |
| - = note: this means that this code causes undefined behavior when executed |
121 |
| - = help: use `MaybeUninit` instead |
| 158 | +LL | struct Ref(&'static i32); |
| 159 | + | ^^^^^^^^^^^^ |
122 | 160 |
|
123 | 161 | error: the type `Ref` does not permit being left uninitialized
|
124 |
| - --> $DIR/uninitialized-zeroed.rs:43:25 |
| 162 | + --> $DIR/uninitialized-zeroed.rs:45:25 |
125 | 163 | |
|
126 | 164 | LL | let _val: Ref = mem::uninitialized();
|
127 | 165 | | ^^^^^^^^^^^^^^^^^^^^
|
| 166 | + | | |
| 167 | + | this code causes undefined behavior when executed |
| 168 | + | help: use `MaybeUninit<T>` instead |
128 | 169 | |
|
129 |
| - = note: this means that this code causes undefined behavior when executed |
130 |
| - = help: use `MaybeUninit` instead |
| 170 | +note: References must be non-null (in this struct field) |
| 171 | + --> $DIR/uninitialized-zeroed.rs:13:12 |
| 172 | + | |
| 173 | +LL | struct Ref(&'static i32); |
| 174 | + | ^^^^^^^^^^^^ |
131 | 175 |
|
132 | 176 | error: the type `fn()` does not permit zero-initialization
|
133 |
| - --> $DIR/uninitialized-zeroed.rs:45:26 |
| 177 | + --> $DIR/uninitialized-zeroed.rs:47:26 |
134 | 178 | |
|
135 | 179 | LL | let _val: fn() = mem::zeroed();
|
136 | 180 | | ^^^^^^^^^^^^^
|
| 181 | + | | |
| 182 | + | this code causes undefined behavior when executed |
| 183 | + | help: use `MaybeUninit<T>` instead |
137 | 184 | |
|
138 |
| - = note: this means that this code causes undefined behavior when executed |
139 |
| - = help: use `MaybeUninit` instead |
| 185 | + = note: Function pointers must be non-null |
140 | 186 |
|
141 | 187 | error: the type `fn()` does not permit being left uninitialized
|
142 |
| - --> $DIR/uninitialized-zeroed.rs:46:26 |
| 188 | + --> $DIR/uninitialized-zeroed.rs:48:26 |
143 | 189 | |
|
144 | 190 | LL | let _val: fn() = mem::uninitialized();
|
145 | 191 | | ^^^^^^^^^^^^^^^^^^^^
|
| 192 | + | | |
| 193 | + | this code causes undefined behavior when executed |
| 194 | + | help: use `MaybeUninit<T>` instead |
146 | 195 | |
|
147 |
| - = note: this means that this code causes undefined behavior when executed |
148 |
| - = help: use `MaybeUninit` instead |
| 196 | + = note: Function pointers must be non-null |
149 | 197 |
|
150 | 198 | error: the type `Wrap<fn()>` does not permit zero-initialization
|
151 |
| - --> $DIR/uninitialized-zeroed.rs:48:32 |
| 199 | + --> $DIR/uninitialized-zeroed.rs:50:32 |
152 | 200 | |
|
153 | 201 | LL | let _val: Wrap<fn()> = mem::zeroed();
|
154 | 202 | | ^^^^^^^^^^^^^
|
| 203 | + | | |
| 204 | + | this code causes undefined behavior when executed |
| 205 | + | help: use `MaybeUninit<T>` instead |
| 206 | + | |
| 207 | +note: Function pointers must be non-null (in this struct field) |
| 208 | + --> $DIR/uninitialized-zeroed.rs:16:18 |
155 | 209 | |
|
156 |
| - = note: this means that this code causes undefined behavior when executed |
157 |
| - = help: use `MaybeUninit` instead |
| 210 | +LL | struct Wrap<T> { wrapped: T } |
| 211 | + | ^^^^^^^^^^ |
158 | 212 |
|
159 | 213 | error: the type `Wrap<fn()>` does not permit being left uninitialized
|
160 |
| - --> $DIR/uninitialized-zeroed.rs:49:32 |
| 214 | + --> $DIR/uninitialized-zeroed.rs:51:32 |
161 | 215 | |
|
162 | 216 | LL | let _val: Wrap<fn()> = mem::uninitialized();
|
163 | 217 | | ^^^^^^^^^^^^^^^^^^^^
|
| 218 | + | | |
| 219 | + | this code causes undefined behavior when executed |
| 220 | + | help: use `MaybeUninit<T>` instead |
| 221 | + | |
| 222 | +note: Function pointers must be non-null (in this struct field) |
| 223 | + --> $DIR/uninitialized-zeroed.rs:16:18 |
| 224 | + | |
| 225 | +LL | struct Wrap<T> { wrapped: T } |
| 226 | + | ^^^^^^^^^^ |
| 227 | + |
| 228 | +error: the type `WrapEnum<fn()>` does not permit zero-initialization |
| 229 | + --> $DIR/uninitialized-zeroed.rs:53:36 |
| 230 | + | |
| 231 | +LL | let _val: WrapEnum<fn()> = mem::zeroed(); |
| 232 | + | ^^^^^^^^^^^^^ |
| 233 | + | | |
| 234 | + | this code causes undefined behavior when executed |
| 235 | + | help: use `MaybeUninit<T>` instead |
| 236 | + | |
| 237 | +note: Function pointers must be non-null (in this enum field) |
| 238 | + --> $DIR/uninitialized-zeroed.rs:17:28 |
| 239 | + | |
| 240 | +LL | enum WrapEnum<T> { Wrapped(T) } |
| 241 | + | ^ |
| 242 | + |
| 243 | +error: the type `WrapEnum<fn()>` does not permit being left uninitialized |
| 244 | + --> $DIR/uninitialized-zeroed.rs:54:36 |
| 245 | + | |
| 246 | +LL | let _val: WrapEnum<fn()> = mem::uninitialized(); |
| 247 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 248 | + | | |
| 249 | + | this code causes undefined behavior when executed |
| 250 | + | help: use `MaybeUninit<T>` instead |
| 251 | + | |
| 252 | +note: Function pointers must be non-null (in this enum field) |
| 253 | + --> $DIR/uninitialized-zeroed.rs:17:28 |
| 254 | + | |
| 255 | +LL | enum WrapEnum<T> { Wrapped(T) } |
| 256 | + | ^ |
| 257 | + |
| 258 | +error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization |
| 259 | + --> $DIR/uninitialized-zeroed.rs:56:42 |
| 260 | + | |
| 261 | +LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed(); |
| 262 | + | ^^^^^^^^^^^^^ |
| 263 | + | | |
| 264 | + | this code causes undefined behavior when executed |
| 265 | + | help: use `MaybeUninit<T>` instead |
| 266 | + | |
| 267 | +note: References must be non-null (in this struct field) |
| 268 | + --> $DIR/uninitialized-zeroed.rs:14:16 |
| 269 | + | |
| 270 | +LL | struct RefPair((&'static i32, i32)); |
| 271 | + | ^^^^^^^^^^^^^^^^^^^ |
| 272 | + |
| 273 | +error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized |
| 274 | + --> $DIR/uninitialized-zeroed.rs:57:42 |
| 275 | + | |
| 276 | +LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized(); |
| 277 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 278 | + | | |
| 279 | + | this code causes undefined behavior when executed |
| 280 | + | help: use `MaybeUninit<T>` instead |
| 281 | + | |
| 282 | +note: References must be non-null (in this struct field) |
| 283 | + --> $DIR/uninitialized-zeroed.rs:14:16 |
164 | 284 | |
|
165 |
| - = note: this means that this code causes undefined behavior when executed |
166 |
| - = help: use `MaybeUninit` instead |
| 285 | +LL | struct RefPair((&'static i32, i32)); |
| 286 | + | ^^^^^^^^^^^^^^^^^^^ |
167 | 287 |
|
168 |
| -error: aborting due to 18 previous errors |
| 288 | +error: aborting due to 22 previous errors |
169 | 289 |
|
0 commit comments