diff --git a/src/destructors.md b/src/destructors.md index bafcbefe0..23b5aa605 100644 --- a/src/destructors.md +++ b/src/destructors.md @@ -2,9 +2,7 @@ When an [initialized] [variable] in Rust goes out of scope or a [temporary] is no longer needed its _destructor_ is run. [Assignment] also runs the -destructor of its left-hand operand, unless it's an uninitialized variable. If a -[struct] variable has been partially initialized, only its initialized fields -are dropped. +destructor of its left-hand operand, unless it's an uninitialized variable. The destructor of a type consists of @@ -63,10 +61,8 @@ loop { moved = ShowOnDrop("Drops when moved"); // drops now, but is then uninitialized moved; + // Uninitialized does not drop. let uninitialized: ShowOnDrop; - // Only first element drops - let mut partially_initialized: (ShowOnDrop, ShowOnDrop); - partially_initialized.0 = ShowOnDrop("Partial tuple first"); } ```