@@ -35,12 +35,11 @@ LL | let _val: Wrap<&'static T> = mem::zeroed();
3535 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
3636 |
3737 = note: `Wrap<&T>` must be non-null
38- note: in this struct field
38+ note: references must be non-null ( in this struct field)
3939 --> $DIR/invalid_value.rs:17:18
4040 |
4141LL | struct Wrap<T> { wrapped: T }
4242 | ^^^^^^^^^^
43- = note: references must be non-null
4443
4544error: the type `Wrap<&T>` does not permit being left uninitialized
4645 --> $DIR/invalid_value.rs:58:38
@@ -52,12 +51,11 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized();
5251 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
5352 |
5453 = note: `Wrap<&T>` must be non-null
55- note: in this struct field
54+ note: references must be non-null ( in this struct field)
5655 --> $DIR/invalid_value.rs:17:18
5756 |
5857LL | struct Wrap<T> { wrapped: T }
5958 | ^^^^^^^^^^
60- = note: references must be non-null
6159
6260error: the type `!` does not permit zero-initialization
6361 --> $DIR/invalid_value.rs:65:23
@@ -165,12 +163,11 @@ LL | let _val: Ref = mem::zeroed();
165163 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
166164 |
167165 = note: `Ref` must be non-null
168- note: in this struct field
166+ note: references must be non-null ( in this struct field)
169167 --> $DIR/invalid_value.rs:14:12
170168 |
171169LL | struct Ref(&'static i32);
172170 | ^^^^^^^^^^^^
173- = note: references must be non-null
174171
175172error: the type `Ref` does not permit being left uninitialized
176173 --> $DIR/invalid_value.rs:78:25
@@ -182,12 +179,11 @@ LL | let _val: Ref = mem::uninitialized();
182179 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
183180 |
184181 = note: `Ref` must be non-null
185- note: in this struct field
182+ note: references must be non-null ( in this struct field)
186183 --> $DIR/invalid_value.rs:14:12
187184 |
188185LL | struct Ref(&'static i32);
189186 | ^^^^^^^^^^^^
190- = note: references must be non-null
191187
192188error: the type `fn()` does not permit zero-initialization
193189 --> $DIR/invalid_value.rs:80:26
@@ -221,12 +217,11 @@ LL | let _val: Wrap<fn()> = mem::zeroed();
221217 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
222218 |
223219 = 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)
225221 --> $DIR/invalid_value.rs:17:18
226222 |
227223LL | struct Wrap<T> { wrapped: T }
228224 | ^^^^^^^^^^
229- = note: function pointers must be non-null
230225
231226error: the type `Wrap<fn()>` does not permit being left uninitialized
232227 --> $DIR/invalid_value.rs:84:32
@@ -238,12 +233,11 @@ LL | let _val: Wrap<fn()> = mem::uninitialized();
238233 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
239234 |
240235 = 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)
242237 --> $DIR/invalid_value.rs:17:18
243238 |
244239LL | struct Wrap<T> { wrapped: T }
245240 | ^^^^^^^^^^
246- = note: function pointers must be non-null
247241
248242error: the type `WrapEnum<fn()>` does not permit zero-initialization
249243 --> $DIR/invalid_value.rs:86:36
@@ -255,12 +249,11 @@ LL | let _val: WrapEnum<fn()> = mem::zeroed();
255249 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
256250 |
257251 = 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)
259253 --> $DIR/invalid_value.rs:18:28
260254 |
261255LL | enum WrapEnum<T> { Wrapped(T) }
262256 | ^
263- = note: function pointers must be non-null
264257
265258error: the type `WrapEnum<fn()>` does not permit being left uninitialized
266259 --> $DIR/invalid_value.rs:87:36
@@ -272,12 +265,11 @@ LL | let _val: WrapEnum<fn()> = mem::uninitialized();
272265 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
273266 |
274267 = 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)
276269 --> $DIR/invalid_value.rs:18:28
277270 |
278271LL | enum WrapEnum<T> { Wrapped(T) }
279272 | ^
280- = note: function pointers must be non-null
281273
282274error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
283275 --> $DIR/invalid_value.rs:89:42
@@ -288,18 +280,16 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
288280 | this code causes undefined behavior when executed
289281 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
290282 |
291- note: in this struct field
283+ note: `RefPair` must be non-null ( in this struct field)
292284 --> $DIR/invalid_value.rs:17:18
293285 |
294286LL | struct Wrap<T> { wrapped: T }
295287 | ^^^^^^^^^^
296- = note: `RefPair` must be non-null
297- note: in this struct field
288+ note: references must be non-null (in this struct field)
298289 --> $DIR/invalid_value.rs:15:16
299290 |
300291LL | struct RefPair((&'static i32, i32));
301292 | ^^^^^^^^^^^^^^^^^^^
302- = note: references must be non-null
303293
304294error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
305295 --> $DIR/invalid_value.rs:90:42
@@ -310,18 +300,16 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
310300 | this code causes undefined behavior when executed
311301 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
312302 |
313- note: in this struct field
303+ note: `RefPair` must be non-null ( in this struct field)
314304 --> $DIR/invalid_value.rs:17:18
315305 |
316306LL | struct Wrap<T> { wrapped: T }
317307 | ^^^^^^^^^^
318- = note: `RefPair` must be non-null
319- note: in this struct field
308+ note: references must be non-null (in this struct field)
320309 --> $DIR/invalid_value.rs:15:16
321310 |
322311LL | struct RefPair((&'static i32, i32));
323312 | ^^^^^^^^^^^^^^^^^^^
324- = note: references must be non-null
325313
326314error: the type `NonNull<i32>` does not permit zero-initialization
327315 --> $DIR/invalid_value.rs:92:34
@@ -344,12 +332,11 @@ LL | let _val: NonNull<i32> = mem::uninitialized();
344332 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
345333 |
346334 = 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)
348336 --> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
349337 |
350338LL | pointer: *const T,
351339 | ^^^^^^^^^^^^^^^^^
352- = note: raw pointers must not be uninitialized
353340
354341error: the type `(NonZeroU32, i32)` does not permit zero-initialization
355342 --> $DIR/invalid_value.rs:95:39
@@ -372,7 +359,7 @@ LL | let _val: (NonZeroU32, i32) = mem::uninitialized();
372359 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
373360 |
374361 = 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)
376363 --> $SRC_DIR/core/src/num/nonzero.rs:LL:COL
377364 |
378365LL | / nonzero_integers! {
@@ -383,7 +370,6 @@ LL | | #[stable(feature = "nonzero", since = "1.28.0")] #[rustc_const_stable
383370LL | | #[stable(feature = "signed_nonzero", since = "1.34.0")] #[rustc_const_stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIs...
384371LL | | }
385372 | |_^
386- = note: integers must not be uninitialized
387373 = note: this error originates in the macro `nonzero_integers` (in Nightly builds, run with -Z macro-backtrace for more info)
388374
389375error: the type `*const dyn Send` does not permit zero-initialization
@@ -470,12 +456,11 @@ LL | let _val: OneFruitNonZero = mem::zeroed();
470456 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
471457 |
472458 = 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)
474460 --> $DIR/invalid_value.rs:39:12
475461 |
476462LL | Banana(NonZeroU32),
477463 | ^^^^^^^^^^
478- = note: `std::num::NonZeroU32` must be non-null
479464
480465error: the type `OneFruitNonZero` does not permit being left uninitialized
481466 --> $DIR/invalid_value.rs:108:37
@@ -487,13 +472,12 @@ LL | let _val: OneFruitNonZero = mem::uninitialized();
487472 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
488473 |
489474 = 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)
491476 --> $DIR/invalid_value.rs:39:12
492477 |
493478LL | Banana(NonZeroU32),
494479 | ^^^^^^^^^^
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)
497481 --> $SRC_DIR/core/src/num/nonzero.rs:LL:COL
498482 |
499483LL | / nonzero_integers! {
@@ -504,7 +488,6 @@ LL | | #[stable(feature = "nonzero", since = "1.28.0")] #[rustc_const_stable
504488LL | | #[stable(feature = "signed_nonzero", since = "1.34.0")] #[rustc_const_stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIs...
505489LL | | }
506490 | |_^
507- = note: integers must not be uninitialized
508491 = note: this error originates in the macro `nonzero_integers` (in Nightly builds, run with -Z macro-backtrace for more info)
509492
510493error: the type `bool` does not permit being left uninitialized
@@ -528,12 +511,11 @@ LL | let _val: Wrap<char> = mem::uninitialized();
528511 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
529512 |
530513 = 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)
532515 --> $DIR/invalid_value.rs:17:18
533516 |
534517LL | struct Wrap<T> { wrapped: T }
535518 | ^^^^^^^^^^
536- = note: characters must be a valid Unicode codepoint
537519
538520error: the type `NonBig` does not permit being left uninitialized
539521 --> $DIR/invalid_value.rs:118:28
@@ -545,12 +527,11 @@ LL | let _val: NonBig = mem::uninitialized();
545527 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
546528 |
547529 = 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)
549531 --> $DIR/invalid_value.rs:23:26
550532 |
551533LL | pub(crate) struct NonBig(u64);
552534 | ^^^
553- = note: integers must not be uninitialized
554535
555536error: the type `Fruit` does not permit being left uninitialized
556537 --> $DIR/invalid_value.rs:121:27
@@ -632,12 +613,11 @@ LL | let _val: WrapAroundRange = mem::uninitialized();
632613 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
633614 |
634615 = 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)
636617 --> $DIR/invalid_value.rs:49:35
637618 |
638619LL | pub(crate) struct WrapAroundRange(u8);
639620 | ^^
640- = note: integers must not be uninitialized
641621
642622error: the type `Result<i32, i32>` does not permit being left uninitialized
643623 --> $DIR/invalid_value.rs:144:38
@@ -708,12 +688,11 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
708688 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
709689 |
710690 = 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)
712692 --> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
713693 |
714694LL | pointer: *const T,
715695 | ^^^^^^^^^^^^^^^^^
716- = note: raw pointers must not be uninitialized
717696
718697error: the type `bool` does not permit being left uninitialized
719698 --> $DIR/invalid_value.rs:159:26
0 commit comments