]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/invalid_value.stderr
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / lint / invalid_value.stderr
1 error: the type `&T` does not permit zero-initialization
2   --> $DIR/invalid_value.rs:54:32
3    |
4 LL |         let _val: &'static T = mem::zeroed();
5    |                                ^^^^^^^^^^^^^
6    |                                |
7    |                                this code causes undefined behavior when executed
8    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
9    |
10    = note: references must be non-null
11 note: the lint level is defined here
12   --> $DIR/invalid_value.rs:6:9
13    |
14 LL | #![deny(invalid_value)]
15    |         ^^^^^^^^^^^^^
16
17 error: the type `&T` does not permit being left uninitialized
18   --> $DIR/invalid_value.rs:55:32
19    |
20 LL |         let _val: &'static T = mem::uninitialized();
21    |                                ^^^^^^^^^^^^^^^^^^^^
22    |                                |
23    |                                this code causes undefined behavior when executed
24    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
25    |
26    = note: references must be non-null
27
28 error: the type `Wrap<&T>` does not permit zero-initialization
29   --> $DIR/invalid_value.rs:57:38
30    |
31 LL |         let _val: Wrap<&'static T> = mem::zeroed();
32    |                                      ^^^^^^^^^^^^^
33    |                                      |
34    |                                      this code causes undefined behavior when executed
35    |                                      help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
36    |
37    = note: `Wrap<&T>` must be non-null
38 note: because references must be non-null (in this struct field)
39   --> $DIR/invalid_value.rs:17:18
40    |
41 LL | struct Wrap<T> { wrapped: T }
42    |                  ^^^^^^^^^^
43
44 error: the type `Wrap<&T>` does not permit being left uninitialized
45   --> $DIR/invalid_value.rs:58:38
46    |
47 LL |         let _val: Wrap<&'static T> = mem::uninitialized();
48    |                                      ^^^^^^^^^^^^^^^^^^^^
49    |                                      |
50    |                                      this code causes undefined behavior when executed
51    |                                      help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
52    |
53    = note: `Wrap<&T>` must be non-null
54 note: because references must be non-null (in this struct field)
55   --> $DIR/invalid_value.rs:17:18
56    |
57 LL | struct Wrap<T> { wrapped: T }
58    |                  ^^^^^^^^^^
59
60 error: the type `!` does not permit zero-initialization
61   --> $DIR/invalid_value.rs:65:23
62    |
63 LL |         let _val: ! = mem::zeroed();
64    |                       ^^^^^^^^^^^^^
65    |                       |
66    |                       this code causes undefined behavior when executed
67    |                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
68    |
69    = note: the `!` type has no valid value
70
71 error: the type `!` does not permit being left uninitialized
72   --> $DIR/invalid_value.rs:66:23
73    |
74 LL |         let _val: ! = mem::uninitialized();
75    |                       ^^^^^^^^^^^^^^^^^^^^
76    |                       |
77    |                       this code causes undefined behavior when executed
78    |                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
79    |
80    = note: the `!` type has no valid value
81
82 error: the type `(i32, !)` does not permit zero-initialization
83   --> $DIR/invalid_value.rs:68:30
84    |
85 LL |         let _val: (i32, !) = mem::zeroed();
86    |                              ^^^^^^^^^^^^^
87    |                              |
88    |                              this code causes undefined behavior when executed
89    |                              help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
90    |
91    = note: the `!` type has no valid value
92
93 error: the type `(i32, !)` does not permit being left uninitialized
94   --> $DIR/invalid_value.rs:69:30
95    |
96 LL |         let _val: (i32, !) = mem::uninitialized();
97    |                              ^^^^^^^^^^^^^^^^^^^^
98    |                              |
99    |                              this code causes undefined behavior when executed
100    |                              help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
101    |
102    = note: integers must be initialized
103
104 error: the type `Void` does not permit zero-initialization
105   --> $DIR/invalid_value.rs:71:26
106    |
107 LL |         let _val: Void = mem::zeroed();
108    |                          ^^^^^^^^^^^^^
109    |                          |
110    |                          this code causes undefined behavior when executed
111    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
112    |
113 note: enums with no inhabited variants have no valid value
114   --> $DIR/invalid_value.rs:12:1
115    |
116 LL | enum Void {}
117    | ^^^^^^^^^
118
119 error: the type `Void` does not permit being left uninitialized
120   --> $DIR/invalid_value.rs:72:26
121    |
122 LL |         let _val: Void = mem::uninitialized();
123    |                          ^^^^^^^^^^^^^^^^^^^^
124    |                          |
125    |                          this code causes undefined behavior when executed
126    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
127    |
128 note: enums with no inhabited variants have no valid value
129   --> $DIR/invalid_value.rs:12:1
130    |
131 LL | enum Void {}
132    | ^^^^^^^^^
133
134 error: the type `&i32` does not permit zero-initialization
135   --> $DIR/invalid_value.rs:74:34
136    |
137 LL |         let _val: &'static i32 = mem::zeroed();
138    |                                  ^^^^^^^^^^^^^
139    |                                  |
140    |                                  this code causes undefined behavior when executed
141    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
142    |
143    = note: references must be non-null
144
145 error: the type `&i32` does not permit being left uninitialized
146   --> $DIR/invalid_value.rs:75:34
147    |
148 LL |         let _val: &'static i32 = mem::uninitialized();
149    |                                  ^^^^^^^^^^^^^^^^^^^^
150    |                                  |
151    |                                  this code causes undefined behavior when executed
152    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
153    |
154    = note: references must be non-null
155
156 error: the type `Ref` does not permit zero-initialization
157   --> $DIR/invalid_value.rs:77:25
158    |
159 LL |         let _val: Ref = mem::zeroed();
160    |                         ^^^^^^^^^^^^^
161    |                         |
162    |                         this code causes undefined behavior when executed
163    |                         help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
164    |
165    = note: `Ref` must be non-null
166 note: because references must be non-null (in this struct field)
167   --> $DIR/invalid_value.rs:14:12
168    |
169 LL | struct Ref(&'static i32);
170    |            ^^^^^^^^^^^^
171
172 error: the type `Ref` does not permit being left uninitialized
173   --> $DIR/invalid_value.rs:78:25
174    |
175 LL |         let _val: Ref = mem::uninitialized();
176    |                         ^^^^^^^^^^^^^^^^^^^^
177    |                         |
178    |                         this code causes undefined behavior when executed
179    |                         help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
180    |
181    = note: `Ref` must be non-null
182 note: because references must be non-null (in this struct field)
183   --> $DIR/invalid_value.rs:14:12
184    |
185 LL | struct Ref(&'static i32);
186    |            ^^^^^^^^^^^^
187
188 error: the type `fn()` does not permit zero-initialization
189   --> $DIR/invalid_value.rs:80:26
190    |
191 LL |         let _val: fn() = mem::zeroed();
192    |                          ^^^^^^^^^^^^^
193    |                          |
194    |                          this code causes undefined behavior when executed
195    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
196    |
197    = note: function pointers must be non-null
198
199 error: the type `fn()` does not permit being left uninitialized
200   --> $DIR/invalid_value.rs:81:26
201    |
202 LL |         let _val: fn() = mem::uninitialized();
203    |                          ^^^^^^^^^^^^^^^^^^^^
204    |                          |
205    |                          this code causes undefined behavior when executed
206    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
207    |
208    = note: function pointers must be non-null
209
210 error: the type `Wrap<fn()>` does not permit zero-initialization
211   --> $DIR/invalid_value.rs:83:32
212    |
213 LL |         let _val: Wrap<fn()> = mem::zeroed();
214    |                                ^^^^^^^^^^^^^
215    |                                |
216    |                                this code causes undefined behavior when executed
217    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
218    |
219    = note: `Wrap<fn()>` must be non-null
220 note: because function pointers must be non-null (in this struct field)
221   --> $DIR/invalid_value.rs:17:18
222    |
223 LL | struct Wrap<T> { wrapped: T }
224    |                  ^^^^^^^^^^
225
226 error: the type `Wrap<fn()>` does not permit being left uninitialized
227   --> $DIR/invalid_value.rs:84:32
228    |
229 LL |         let _val: Wrap<fn()> = mem::uninitialized();
230    |                                ^^^^^^^^^^^^^^^^^^^^
231    |                                |
232    |                                this code causes undefined behavior when executed
233    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
234    |
235    = note: `Wrap<fn()>` must be non-null
236 note: because function pointers must be non-null (in this struct field)
237   --> $DIR/invalid_value.rs:17:18
238    |
239 LL | struct Wrap<T> { wrapped: T }
240    |                  ^^^^^^^^^^
241
242 error: the type `WrapEnum<fn()>` does not permit zero-initialization
243   --> $DIR/invalid_value.rs:86:36
244    |
245 LL |         let _val: WrapEnum<fn()> = mem::zeroed();
246    |                                    ^^^^^^^^^^^^^
247    |                                    |
248    |                                    this code causes undefined behavior when executed
249    |                                    help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
250    |
251    = note: `WrapEnum<fn()>` must be non-null
252 note: because function pointers must be non-null (in this field of the only potentially inhabited enum variant)
253   --> $DIR/invalid_value.rs:18:28
254    |
255 LL | enum WrapEnum<T> { Wrapped(T) }
256    |                            ^
257
258 error: the type `WrapEnum<fn()>` does not permit being left uninitialized
259   --> $DIR/invalid_value.rs:87:36
260    |
261 LL |         let _val: WrapEnum<fn()> = mem::uninitialized();
262    |                                    ^^^^^^^^^^^^^^^^^^^^
263    |                                    |
264    |                                    this code causes undefined behavior when executed
265    |                                    help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
266    |
267    = note: `WrapEnum<fn()>` must be non-null
268 note: because function pointers must be non-null (in this field of the only potentially inhabited enum variant)
269   --> $DIR/invalid_value.rs:18:28
270    |
271 LL | enum WrapEnum<T> { Wrapped(T) }
272    |                            ^
273
274 error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
275   --> $DIR/invalid_value.rs:89:42
276    |
277 LL |         let _val: Wrap<(RefPair, i32)> = mem::zeroed();
278    |                                          ^^^^^^^^^^^^^
279    |                                          |
280    |                                          this code causes undefined behavior when executed
281    |                                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
282    |
283 note: `RefPair` must be non-null (in this struct field)
284   --> $DIR/invalid_value.rs:17:18
285    |
286 LL | struct Wrap<T> { wrapped: T }
287    |                  ^^^^^^^^^^
288 note: because references must be non-null (in this struct field)
289   --> $DIR/invalid_value.rs:15:16
290    |
291 LL | struct RefPair((&'static i32, i32));
292    |                ^^^^^^^^^^^^^^^^^^^
293
294 error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
295   --> $DIR/invalid_value.rs:90:42
296    |
297 LL |         let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
298    |                                          ^^^^^^^^^^^^^^^^^^^^
299    |                                          |
300    |                                          this code causes undefined behavior when executed
301    |                                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
302    |
303 note: `RefPair` must be non-null (in this struct field)
304   --> $DIR/invalid_value.rs:17:18
305    |
306 LL | struct Wrap<T> { wrapped: T }
307    |                  ^^^^^^^^^^
308 note: because references must be non-null (in this struct field)
309   --> $DIR/invalid_value.rs:15:16
310    |
311 LL | struct RefPair((&'static i32, i32));
312    |                ^^^^^^^^^^^^^^^^^^^
313
314 error: the type `NonNull<i32>` does not permit zero-initialization
315   --> $DIR/invalid_value.rs:92:34
316    |
317 LL |         let _val: NonNull<i32> = mem::zeroed();
318    |                                  ^^^^^^^^^^^^^
319    |                                  |
320    |                                  this code causes undefined behavior when executed
321    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
322    |
323    = note: `std::ptr::NonNull<i32>` must be non-null
324
325 error: the type `NonNull<i32>` does not permit being left uninitialized
326   --> $DIR/invalid_value.rs:93:34
327    |
328 LL |         let _val: NonNull<i32> = mem::uninitialized();
329    |                                  ^^^^^^^^^^^^^^^^^^^^
330    |                                  |
331    |                                  this code causes undefined behavior when executed
332    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
333    |
334    = note: `std::ptr::NonNull<i32>` must be non-null
335    = note: raw pointers must be initialized
336
337 error: the type `(NonZeroU32, i32)` does not permit zero-initialization
338   --> $DIR/invalid_value.rs:95:39
339    |
340 LL |         let _val: (NonZeroU32, i32) = mem::zeroed();
341    |                                       ^^^^^^^^^^^^^
342    |                                       |
343    |                                       this code causes undefined behavior when executed
344    |                                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
345    |
346    = note: `std::num::NonZeroU32` must be non-null
347
348 error: the type `(NonZeroU32, i32)` does not permit being left uninitialized
349   --> $DIR/invalid_value.rs:96:39
350    |
351 LL |         let _val: (NonZeroU32, i32) = mem::uninitialized();
352    |                                       ^^^^^^^^^^^^^^^^^^^^
353    |                                       |
354    |                                       this code causes undefined behavior when executed
355    |                                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
356    |
357    = note: `std::num::NonZeroU32` must be non-null
358    = note: integers must be initialized
359
360 error: the type `*const dyn Send` does not permit zero-initialization
361   --> $DIR/invalid_value.rs:98:37
362    |
363 LL |         let _val: *const dyn Send = mem::zeroed();
364    |                                     ^^^^^^^^^^^^^
365    |                                     |
366    |                                     this code causes undefined behavior when executed
367    |                                     help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
368    |
369    = note: the vtable of a wide raw pointer must be non-null
370
371 error: the type `*const dyn Send` does not permit being left uninitialized
372   --> $DIR/invalid_value.rs:99:37
373    |
374 LL |         let _val: *const dyn Send = mem::uninitialized();
375    |                                     ^^^^^^^^^^^^^^^^^^^^
376    |                                     |
377    |                                     this code causes undefined behavior when executed
378    |                                     help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
379    |
380    = note: the vtable of a wide raw pointer must be non-null
381
382 error: the type `[fn(); 2]` does not permit zero-initialization
383   --> $DIR/invalid_value.rs:101:31
384    |
385 LL |         let _val: [fn(); 2] = mem::zeroed();
386    |                               ^^^^^^^^^^^^^
387    |                               |
388    |                               this code causes undefined behavior when executed
389    |                               help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
390    |
391    = note: function pointers must be non-null
392
393 error: the type `[fn(); 2]` does not permit being left uninitialized
394   --> $DIR/invalid_value.rs:102:31
395    |
396 LL |         let _val: [fn(); 2] = mem::uninitialized();
397    |                               ^^^^^^^^^^^^^^^^^^^^
398    |                               |
399    |                               this code causes undefined behavior when executed
400    |                               help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
401    |
402    = note: function pointers must be non-null
403
404 error: the type `TwoUninhabited` does not permit zero-initialization
405   --> $DIR/invalid_value.rs:104:36
406    |
407 LL |         let _val: TwoUninhabited = mem::zeroed();
408    |                                    ^^^^^^^^^^^^^
409    |                                    |
410    |                                    this code causes undefined behavior when executed
411    |                                    help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
412    |
413 note: enums with no inhabited variants have no valid value
414   --> $DIR/invalid_value.rs:42:1
415    |
416 LL | enum TwoUninhabited {
417    | ^^^^^^^^^^^^^^^^^^^
418
419 error: the type `TwoUninhabited` does not permit being left uninitialized
420   --> $DIR/invalid_value.rs:105:36
421    |
422 LL |         let _val: TwoUninhabited = mem::uninitialized();
423    |                                    ^^^^^^^^^^^^^^^^^^^^
424    |                                    |
425    |                                    this code causes undefined behavior when executed
426    |                                    help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
427    |
428 note: enums with no inhabited variants have no valid value
429   --> $DIR/invalid_value.rs:42:1
430    |
431 LL | enum TwoUninhabited {
432    | ^^^^^^^^^^^^^^^^^^^
433
434 error: the type `OneFruitNonZero` does not permit zero-initialization
435   --> $DIR/invalid_value.rs:107:37
436    |
437 LL |         let _val: OneFruitNonZero = mem::zeroed();
438    |                                     ^^^^^^^^^^^^^
439    |                                     |
440    |                                     this code causes undefined behavior when executed
441    |                                     help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
442    |
443    = note: `OneFruitNonZero` must be non-null
444 note: because `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
445   --> $DIR/invalid_value.rs:39:12
446    |
447 LL |     Banana(NonZeroU32),
448    |            ^^^^^^^^^^
449
450 error: the type `OneFruitNonZero` does not permit being left uninitialized
451   --> $DIR/invalid_value.rs:108:37
452    |
453 LL |         let _val: OneFruitNonZero = mem::uninitialized();
454    |                                     ^^^^^^^^^^^^^^^^^^^^
455    |                                     |
456    |                                     this code causes undefined behavior when executed
457    |                                     help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
458    |
459    = note: `OneFruitNonZero` must be non-null
460 note: because `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
461   --> $DIR/invalid_value.rs:39:12
462    |
463 LL |     Banana(NonZeroU32),
464    |            ^^^^^^^^^^
465    = note: integers must be initialized
466
467 error: the type `bool` does not permit being left uninitialized
468   --> $DIR/invalid_value.rs:112:26
469    |
470 LL |         let _val: bool = mem::uninitialized();
471    |                          ^^^^^^^^^^^^^^^^^^^^
472    |                          |
473    |                          this code causes undefined behavior when executed
474    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
475    |
476    = note: booleans must be either `true` or `false`
477
478 error: the type `Wrap<char>` does not permit being left uninitialized
479   --> $DIR/invalid_value.rs:115:32
480    |
481 LL |         let _val: Wrap<char> = mem::uninitialized();
482    |                                ^^^^^^^^^^^^^^^^^^^^
483    |                                |
484    |                                this code causes undefined behavior when executed
485    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
486    |
487    = note: `Wrap<char>` must be initialized inside its custom valid range
488 note: characters must be a valid Unicode codepoint (in this struct field)
489   --> $DIR/invalid_value.rs:17:18
490    |
491 LL | struct Wrap<T> { wrapped: T }
492    |                  ^^^^^^^^^^
493
494 error: the type `NonBig` does not permit being left uninitialized
495   --> $DIR/invalid_value.rs:118:28
496    |
497 LL |         let _val: NonBig = mem::uninitialized();
498    |                            ^^^^^^^^^^^^^^^^^^^^
499    |                            |
500    |                            this code causes undefined behavior when executed
501    |                            help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
502    |
503    = note: `NonBig` must be initialized inside its custom valid range
504 note: integers must be initialized (in this struct field)
505   --> $DIR/invalid_value.rs:23:26
506    |
507 LL | pub(crate) struct NonBig(u64);
508    |                          ^^^
509
510 error: the type `Fruit` does not permit being left uninitialized
511   --> $DIR/invalid_value.rs:121:27
512    |
513 LL |         let _val: Fruit = mem::uninitialized();
514    |                           ^^^^^^^^^^^^^^^^^^^^
515    |                           |
516    |                           this code causes undefined behavior when executed
517    |                           help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
518    |
519 note: enums with multiple inhabited variants have to be initialized to a variant
520   --> $DIR/invalid_value.rs:26:1
521    |
522 LL | enum Fruit {
523    | ^^^^^^^^^^
524
525 error: the type `[bool; 2]` does not permit being left uninitialized
526   --> $DIR/invalid_value.rs:124:31
527    |
528 LL |         let _val: [bool; 2] = mem::uninitialized();
529    |                               ^^^^^^^^^^^^^^^^^^^^
530    |                               |
531    |                               this code causes undefined behavior when executed
532    |                               help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
533    |
534    = note: booleans must be either `true` or `false`
535
536 error: the type `i32` does not permit being left uninitialized
537   --> $DIR/invalid_value.rs:127:25
538    |
539 LL |         let _val: i32 = mem::uninitialized();
540    |                         ^^^^^^^^^^^^^^^^^^^^
541    |                         |
542    |                         this code causes undefined behavior when executed
543    |                         help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
544    |
545    = note: integers must be initialized
546
547 error: the type `f32` does not permit being left uninitialized
548   --> $DIR/invalid_value.rs:130:25
549    |
550 LL |         let _val: f32 = mem::uninitialized();
551    |                         ^^^^^^^^^^^^^^^^^^^^
552    |                         |
553    |                         this code causes undefined behavior when executed
554    |                         help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
555    |
556    = note: floats must be initialized
557
558 error: the type `*const ()` does not permit being left uninitialized
559   --> $DIR/invalid_value.rs:133:31
560    |
561 LL |         let _val: *const () = mem::uninitialized();
562    |                               ^^^^^^^^^^^^^^^^^^^^
563    |                               |
564    |                               this code causes undefined behavior when executed
565    |                               help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
566    |
567    = note: raw pointers must be initialized
568
569 error: the type `*const [()]` does not permit being left uninitialized
570   --> $DIR/invalid_value.rs:136:33
571    |
572 LL |         let _val: *const [()] = mem::uninitialized();
573    |                                 ^^^^^^^^^^^^^^^^^^^^
574    |                                 |
575    |                                 this code causes undefined behavior when executed
576    |                                 help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
577    |
578    = note: raw pointers must be initialized
579
580 error: the type `WrapAroundRange` does not permit being left uninitialized
581   --> $DIR/invalid_value.rs:139:37
582    |
583 LL |         let _val: WrapAroundRange = mem::uninitialized();
584    |                                     ^^^^^^^^^^^^^^^^^^^^
585    |                                     |
586    |                                     this code causes undefined behavior when executed
587    |                                     help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
588    |
589    = note: `WrapAroundRange` must be initialized inside its custom valid range
590 note: integers must be initialized (in this struct field)
591   --> $DIR/invalid_value.rs:49:35
592    |
593 LL | pub(crate) struct WrapAroundRange(u8);
594    |                                   ^^
595
596 error: the type `Result<i32, i32>` does not permit being left uninitialized
597   --> $DIR/invalid_value.rs:144:38
598    |
599 LL |         let _val: Result<i32, i32> = mem::uninitialized();
600    |                                      ^^^^^^^^^^^^^^^^^^^^
601    |                                      |
602    |                                      this code causes undefined behavior when executed
603    |                                      help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
604    |
605 note: enums with multiple inhabited variants have to be initialized to a variant
606   --> $SRC_DIR/core/src/result.rs:LL:COL
607
608 error: the type `&i32` does not permit zero-initialization
609   --> $DIR/invalid_value.rs:152:34
610    |
611 LL |         let _val: &'static i32 = mem::transmute(0usize);
612    |                                  ^^^^^^^^^^^^^^^^^^^^^^
613    |                                  |
614    |                                  this code causes undefined behavior when executed
615    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
616    |
617    = note: references must be non-null
618
619 error: the type `&[i32]` does not permit zero-initialization
620   --> $DIR/invalid_value.rs:153:36
621    |
622 LL |         let _val: &'static [i32] = mem::transmute((0usize, 0usize));
623    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
624    |                                    |
625    |                                    this code causes undefined behavior when executed
626    |                                    help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
627    |
628    = note: references must be non-null
629
630 error: the type `NonZeroU32` does not permit zero-initialization
631   --> $DIR/invalid_value.rs:154:32
632    |
633 LL |         let _val: NonZeroU32 = mem::transmute(0);
634    |                                ^^^^^^^^^^^^^^^^^
635    |                                |
636    |                                this code causes undefined behavior when executed
637    |                                help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
638    |
639    = note: `std::num::NonZeroU32` must be non-null
640
641 error: the type `NonNull<i32>` does not permit zero-initialization
642   --> $DIR/invalid_value.rs:157:34
643    |
644 LL |         let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
645    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
646    |                                  |
647    |                                  this code causes undefined behavior when executed
648    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
649    |
650    = note: `std::ptr::NonNull<i32>` must be non-null
651
652 error: the type `NonNull<i32>` does not permit being left uninitialized
653   --> $DIR/invalid_value.rs:158:34
654    |
655 LL |         let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
656    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
657    |                                  |
658    |                                  this code causes undefined behavior when executed
659    |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
660    |
661    = note: `std::ptr::NonNull<i32>` must be non-null
662    = note: raw pointers must be initialized
663
664 error: the type `bool` does not permit being left uninitialized
665   --> $DIR/invalid_value.rs:159:26
666    |
667 LL |         let _val: bool = MaybeUninit::uninit().assume_init();
668    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
669    |                          |
670    |                          this code causes undefined behavior when executed
671    |                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
672    |
673    = note: booleans must be either `true` or `false`
674
675 error: aborting due to 51 previous errors
676