@@ -61,54 +61,39 @@ error: the type `!` does not permit zero-initialization
61
61
--> $DIR/invalid_value.rs:65:23
62
62
|
63
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
64
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
68
65
|
69
66
= note: the `!` type has no valid value
70
67
71
68
error: the type `!` does not permit being left uninitialized
72
69
--> $DIR/invalid_value.rs:66:23
73
70
|
74
71
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
72
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
79
73
|
80
74
= note: the `!` type has no valid value
81
75
82
76
error: the type `(i32, !)` does not permit zero-initialization
83
77
--> $DIR/invalid_value.rs:68:30
84
78
|
85
79
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
80
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
90
81
|
91
82
= note: the `!` type has no valid value
92
83
93
84
error: the type `(i32, !)` does not permit being left uninitialized
94
85
--> $DIR/invalid_value.rs:69:30
95
86
|
96
87
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
88
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
101
89
|
102
90
= note: integers must be initialized
103
91
104
92
error: the type `Void` does not permit zero-initialization
105
93
--> $DIR/invalid_value.rs:71:26
106
94
|
107
95
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
96
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
112
97
|
113
98
note: enums with no inhabited variants have no valid value
114
99
--> $DIR/invalid_value.rs:12:1
@@ -120,10 +105,7 @@ error: the type `Void` does not permit being left uninitialized
120
105
--> $DIR/invalid_value.rs:72:26
121
106
|
122
107
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
108
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
127
109
|
128
110
note: enums with no inhabited variants have no valid value
129
111
--> $DIR/invalid_value.rs:12:1
@@ -405,10 +387,7 @@ error: the type `TwoUninhabited` does not permit zero-initialization
405
387
--> $DIR/invalid_value.rs:104:36
406
388
|
407
389
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
390
+ | ^^^^^^^^^^^^^ this code causes undefined behavior when executed
412
391
|
413
392
note: enums with no inhabited variants have no valid value
414
393
--> $DIR/invalid_value.rs:42:1
@@ -420,10 +399,7 @@ error: the type `TwoUninhabited` does not permit being left uninitialized
420
399
--> $DIR/invalid_value.rs:105:36
421
400
|
422
401
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
402
+ | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
427
403
|
428
404
note: enums with no inhabited variants have no valid value
429
405
--> $DIR/invalid_value.rs:42:1
0 commit comments