Skip to content

Commit e3966e5

Browse files
committed
Remove partially initialized values from drop documentation.
1 parent 1528956 commit e3966e5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/destructors.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
When an [initialized] [variable] in Rust goes out of scope or a [temporary]
44
is no longer needed its _destructor_ is run. [Assignment] also runs the
5-
destructor of its left-hand operand, unless it's an uninitialized variable. If a
6-
[struct] variable has been partially initialized, only its initialized fields
7-
are dropped.
5+
destructor of its left-hand operand, unless it's an uninitialized variable.
86

97
The destructor of a type consists of
108

@@ -63,10 +61,8 @@ loop {
6361
moved = ShowOnDrop("Drops when moved");
6462
// drops now, but is then uninitialized
6563
moved;
64+
// Uninitialized does not drop.
6665
let uninitialized: ShowOnDrop;
67-
// Only first element drops
68-
let mut partially_initialized: (ShowOnDrop, ShowOnDrop);
69-
partially_initialized.0 = ShowOnDrop("Partial tuple first");
7066
}
7167
```
7268

0 commit comments

Comments
 (0)