@@ -138,6 +138,30 @@ Book:
138
138
https://doc.rust-lang.org/book/ownership.html
139
139
"## ,
140
140
141
+ E0383 : r##"
142
+ This error occurs when an attempt is made to partially reinitialize a
143
+ structure that is currently uninitialized.
144
+
145
+ For example, this can happen when a transfer of ownership has taken place:
146
+
147
+ ```
148
+ let mut t = Test { a: 1, b: None};
149
+ let mut u = Test { a: 2, b: Some(Box::new(t))}; // `t` is now uninitialized
150
+ // because ownership has been
151
+ // transferred
152
+ t.b = Some(Box::new(u)); // error, partial reinitialization of uninitialized
153
+ // structure `t`
154
+ ```
155
+
156
+ This error can be fixed by fully reinitializing the structure in question:
157
+
158
+ ```
159
+ let mut t = Test { a: 1, b: None};
160
+ let mut u = Test { a: 2, b: Some(Box::new(t))};
161
+ t = Test { a: 1, b: Some(Box::new(u))};
162
+ ```
163
+ "## ,
164
+
141
165
E0384 : r##"
142
166
This error occurs when an attempt is made to reassign an immutable variable.
143
167
For example:
@@ -217,7 +241,6 @@ https://doc.rust-lang.org/std/cell/
217
241
}
218
242
219
243
register_diagnostics ! {
220
- E0383 , // partial reinitialization of uninitialized structure
221
244
E0385 , // {} in an aliasable location
222
245
E0386 , // {} in an immutable container
223
246
E0388 , // {} in a static location
0 commit comments