From e3966e55e0d8129ffadb8e39b2588de8d71564dc Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 6 Aug 2019 06:24:21 -0700 Subject: [PATCH] Remove partially initialized values from drop documentation. --- src/destructors.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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"); } ```