File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,27 @@ Book:
138138https://doc.rust-lang.org/book/ownership.html
139139"## ,
140140
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 drop has taken place:
146+
147+ ```
148+ let mut x = Foo { a: 1 };
149+ drop(x); // `x` is now uninitialized
150+ x.a = 2; // error, partial reinitialization of uninitialized structure `t`
151+ ```
152+
153+ This error can be fixed by fully reinitializing the structure in question:
154+
155+ ```
156+ let mut x = Foo { a: 1 };
157+ drop(x);
158+ x = Foo { a: 2 };
159+ ```
160+ "## ,
161+
141162E0384 : r##"
142163This error occurs when an attempt is made to reassign an immutable variable.
143164For example:
@@ -217,7 +238,6 @@ https://doc.rust-lang.org/std/cell/
217238}
218239
219240register_diagnostics ! {
220- E0383 , // partial reinitialization of uninitialized structure
221241 E0385 , // {} in an aliasable location
222242 E0386 , // {} in an immutable container
223243 E0388 , // {} in a static location
You can’t perform that action at this time.
0 commit comments