@@ -35,12 +35,11 @@ LL | let _val: Wrap<&'static T> = mem::zeroed();
35
35
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
36
36
|
37
37
= note: `Wrap<&T>` must be non-null
38
- note: in this struct field
38
+ note: references must be non-null ( in this struct field)
39
39
--> $DIR/invalid_value.rs:17:18
40
40
|
41
41
LL | struct Wrap<T> { wrapped: T }
42
42
| ^^^^^^^^^^
43
- = note: references must be non-null
44
43
45
44
error: the type `Wrap<&T>` does not permit being left uninitialized
46
45
--> $DIR/invalid_value.rs:58:38
@@ -52,12 +51,11 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized();
52
51
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
53
52
|
54
53
= note: `Wrap<&T>` must be non-null
55
- note: in this struct field
54
+ note: references must be non-null ( in this struct field)
56
55
--> $DIR/invalid_value.rs:17:18
57
56
|
58
57
LL | struct Wrap<T> { wrapped: T }
59
58
| ^^^^^^^^^^
60
- = note: references must be non-null
61
59
62
60
error: the type `!` does not permit zero-initialization
63
61
--> $DIR/invalid_value.rs:65:23
@@ -165,12 +163,11 @@ LL | let _val: Ref = mem::zeroed();
165
163
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
166
164
|
167
165
= note: `Ref` must be non-null
168
- note: in this struct field
166
+ note: references must be non-null ( in this struct field)
169
167
--> $DIR/invalid_value.rs:14:12
170
168
|
171
169
LL | struct Ref(&'static i32);
172
170
| ^^^^^^^^^^^^
173
- = note: references must be non-null
174
171
175
172
error: the type `Ref` does not permit being left uninitialized
176
173
--> $DIR/invalid_value.rs:78:25
@@ -182,12 +179,11 @@ LL | let _val: Ref = mem::uninitialized();
182
179
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
183
180
|
184
181
= note: `Ref` must be non-null
185
- note: in this struct field
182
+ note: references must be non-null ( in this struct field)
186
183
--> $DIR/invalid_value.rs:14:12
187
184
|
188
185
LL | struct Ref(&'static i32);
189
186
| ^^^^^^^^^^^^
190
- = note: references must be non-null
191
187
192
188
error: the type `fn()` does not permit zero-initialization
193
189
--> $DIR/invalid_value.rs:80:26
@@ -221,12 +217,11 @@ LL | let _val: Wrap<fn()> = mem::zeroed();
221
217
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
222
218
|
223
219
= note: `Wrap<fn()>` must be non-null
224
- note: in this struct field
220
+ note: function pointers must be non-null ( in this struct field)
225
221
--> $DIR/invalid_value.rs:17:18
226
222
|
227
223
LL | struct Wrap<T> { wrapped: T }
228
224
| ^^^^^^^^^^
229
- = note: function pointers must be non-null
230
225
231
226
error: the type `Wrap<fn()>` does not permit being left uninitialized
232
227
--> $DIR/invalid_value.rs:84:32
@@ -238,12 +233,11 @@ LL | let _val: Wrap<fn()> = mem::uninitialized();
238
233
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
239
234
|
240
235
= note: `Wrap<fn()>` must be non-null
241
- note: in this struct field
236
+ note: function pointers must be non-null ( in this struct field)
242
237
--> $DIR/invalid_value.rs:17:18
243
238
|
244
239
LL | struct Wrap<T> { wrapped: T }
245
240
| ^^^^^^^^^^
246
- = note: function pointers must be non-null
247
241
248
242
error: the type `WrapEnum<fn()>` does not permit zero-initialization
249
243
--> $DIR/invalid_value.rs:86:36
@@ -255,12 +249,11 @@ LL | let _val: WrapEnum<fn()> = mem::zeroed();
255
249
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
256
250
|
257
251
= note: `WrapEnum<fn()>` must be non-null
258
- note: in this field of the only potentially inhabited enum variant
252
+ note: function pointers must be non-null ( in this field of the only potentially inhabited enum variant)
259
253
--> $DIR/invalid_value.rs:18:28
260
254
|
261
255
LL | enum WrapEnum<T> { Wrapped(T) }
262
256
| ^
263
- = note: function pointers must be non-null
264
257
265
258
error: the type `WrapEnum<fn()>` does not permit being left uninitialized
266
259
--> $DIR/invalid_value.rs:87:36
@@ -272,12 +265,11 @@ LL | let _val: WrapEnum<fn()> = mem::uninitialized();
272
265
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
273
266
|
274
267
= note: `WrapEnum<fn()>` must be non-null
275
- note: in this field of the only potentially inhabited enum variant
268
+ note: function pointers must be non-null ( in this field of the only potentially inhabited enum variant)
276
269
--> $DIR/invalid_value.rs:18:28
277
270
|
278
271
LL | enum WrapEnum<T> { Wrapped(T) }
279
272
| ^
280
- = note: function pointers must be non-null
281
273
282
274
error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
283
275
--> $DIR/invalid_value.rs:89:42
@@ -288,18 +280,16 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
288
280
| this code causes undefined behavior when executed
289
281
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
290
282
|
291
- note: in this struct field
283
+ note: `RefPair` must be non-null ( in this struct field)
292
284
--> $DIR/invalid_value.rs:17:18
293
285
|
294
286
LL | struct Wrap<T> { wrapped: T }
295
287
| ^^^^^^^^^^
296
- = note: `RefPair` must be non-null
297
- note: in this struct field
288
+ note: references must be non-null (in this struct field)
298
289
--> $DIR/invalid_value.rs:15:16
299
290
|
300
291
LL | struct RefPair((&'static i32, i32));
301
292
| ^^^^^^^^^^^^^^^^^^^
302
- = note: references must be non-null
303
293
304
294
error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
305
295
--> $DIR/invalid_value.rs:90:42
@@ -310,18 +300,16 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
310
300
| this code causes undefined behavior when executed
311
301
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
312
302
|
313
- note: in this struct field
303
+ note: `RefPair` must be non-null ( in this struct field)
314
304
--> $DIR/invalid_value.rs:17:18
315
305
|
316
306
LL | struct Wrap<T> { wrapped: T }
317
307
| ^^^^^^^^^^
318
- = note: `RefPair` must be non-null
319
- note: in this struct field
308
+ note: references must be non-null (in this struct field)
320
309
--> $DIR/invalid_value.rs:15:16
321
310
|
322
311
LL | struct RefPair((&'static i32, i32));
323
312
| ^^^^^^^^^^^^^^^^^^^
324
- = note: references must be non-null
325
313
326
314
error: the type `NonNull<i32>` does not permit zero-initialization
327
315
--> $DIR/invalid_value.rs:92:34
@@ -344,12 +332,11 @@ LL | let _val: NonNull<i32> = mem::uninitialized();
344
332
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
345
333
|
346
334
= note: `std::ptr::NonNull<i32>` must be non-null
347
- note: in this struct field
335
+ note: raw pointers must not be uninitialized ( in this struct field)
348
336
--> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
349
337
|
350
338
LL | pointer: *const T,
351
339
| ^^^^^^^^^^^^^^^^^
352
- = note: raw pointers must not be uninitialized
353
340
354
341
error: the type `(NonZeroU32, i32)` does not permit zero-initialization
355
342
--> $DIR/invalid_value.rs:95:39
@@ -372,7 +359,7 @@ LL | let _val: (NonZeroU32, i32) = mem::uninitialized();
372
359
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
373
360
|
374
361
= note: `std::num::NonZeroU32` must be non-null
375
- note: in this struct field
362
+ note: integers must not be uninitialized ( in this struct field)
376
363
--> $SRC_DIR/core/src/num/nonzero.rs:LL:COL
377
364
|
378
365
LL | / nonzero_integers! {
@@ -383,7 +370,6 @@ LL | | #[stable(feature = "nonzero", since = "1.28.0")] #[rustc_const_stable
383
370
LL | | #[stable(feature = "signed_nonzero", since = "1.34.0")] #[rustc_const_stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIs...
384
371
LL | | }
385
372
| |_^
386
- = note: integers must not be uninitialized
387
373
= note: this error originates in the macro `nonzero_integers` (in Nightly builds, run with -Z macro-backtrace for more info)
388
374
389
375
error: the type `*const dyn Send` does not permit zero-initialization
@@ -470,12 +456,11 @@ LL | let _val: OneFruitNonZero = mem::zeroed();
470
456
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
471
457
|
472
458
= note: `OneFruitNonZero` must be non-null
473
- note: in this field of the only potentially inhabited enum variant
459
+ note: `std::num::NonZeroU32` must be non-null ( in this field of the only potentially inhabited enum variant)
474
460
--> $DIR/invalid_value.rs:39:12
475
461
|
476
462
LL | Banana(NonZeroU32),
477
463
| ^^^^^^^^^^
478
- = note: `std::num::NonZeroU32` must be non-null
479
464
480
465
error: the type `OneFruitNonZero` does not permit being left uninitialized
481
466
--> $DIR/invalid_value.rs:108:37
@@ -487,13 +472,12 @@ LL | let _val: OneFruitNonZero = mem::uninitialized();
487
472
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
488
473
|
489
474
= note: `OneFruitNonZero` must be non-null
490
- note: in this field of the only potentially inhabited enum variant
475
+ note: `std::num::NonZeroU32` must be non-null ( in this field of the only potentially inhabited enum variant)
491
476
--> $DIR/invalid_value.rs:39:12
492
477
|
493
478
LL | Banana(NonZeroU32),
494
479
| ^^^^^^^^^^
495
- = note: `std::num::NonZeroU32` must be non-null
496
- note: in this struct field
480
+ note: integers must not be uninitialized (in this struct field)
497
481
--> $SRC_DIR/core/src/num/nonzero.rs:LL:COL
498
482
|
499
483
LL | / nonzero_integers! {
@@ -504,7 +488,6 @@ LL | | #[stable(feature = "nonzero", since = "1.28.0")] #[rustc_const_stable
504
488
LL | | #[stable(feature = "signed_nonzero", since = "1.34.0")] #[rustc_const_stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIs...
505
489
LL | | }
506
490
| |_^
507
- = note: integers must not be uninitialized
508
491
= note: this error originates in the macro `nonzero_integers` (in Nightly builds, run with -Z macro-backtrace for more info)
509
492
510
493
error: the type `bool` does not permit being left uninitialized
@@ -528,12 +511,11 @@ LL | let _val: Wrap<char> = mem::uninitialized();
528
511
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
529
512
|
530
513
= note: `Wrap<char>` must be initialized inside its custom valid range
531
- note: in this struct field
514
+ note: characters must be a valid Unicode codepoint ( in this struct field)
532
515
--> $DIR/invalid_value.rs:17:18
533
516
|
534
517
LL | struct Wrap<T> { wrapped: T }
535
518
| ^^^^^^^^^^
536
- = note: characters must be a valid Unicode codepoint
537
519
538
520
error: the type `NonBig` does not permit being left uninitialized
539
521
--> $DIR/invalid_value.rs:118:28
@@ -545,12 +527,11 @@ LL | let _val: NonBig = mem::uninitialized();
545
527
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
546
528
|
547
529
= note: `NonBig` must be initialized inside its custom valid range
548
- note: in this struct field
530
+ note: integers must not be uninitialized ( in this struct field)
549
531
--> $DIR/invalid_value.rs:23:26
550
532
|
551
533
LL | pub(crate) struct NonBig(u64);
552
534
| ^^^
553
- = note: integers must not be uninitialized
554
535
555
536
error: the type `Fruit` does not permit being left uninitialized
556
537
--> $DIR/invalid_value.rs:121:27
@@ -632,12 +613,11 @@ LL | let _val: WrapAroundRange = mem::uninitialized();
632
613
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
633
614
|
634
615
= note: `WrapAroundRange` must be initialized inside its custom valid range
635
- note: in this struct field
616
+ note: integers must not be uninitialized ( in this struct field)
636
617
--> $DIR/invalid_value.rs:49:35
637
618
|
638
619
LL | pub(crate) struct WrapAroundRange(u8);
639
620
| ^^
640
- = note: integers must not be uninitialized
641
621
642
622
error: the type `Result<i32, i32>` does not permit being left uninitialized
643
623
--> $DIR/invalid_value.rs:144:38
@@ -708,12 +688,11 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
708
688
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
709
689
|
710
690
= note: `std::ptr::NonNull<i32>` must be non-null
711
- note: in this struct field
691
+ note: raw pointers must not be uninitialized ( in this struct field)
712
692
--> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
713
693
|
714
694
LL | pointer: *const T,
715
695
| ^^^^^^^^^^^^^^^^^
716
- = note: raw pointers must not be uninitialized
717
696
718
697
error: the type `bool` does not permit being left uninitialized
719
698
--> $DIR/invalid_value.rs:159:26
0 commit comments