File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 22
33When an [ initialized]   ; [ variable] in Rust goes out of scope or a [ temporary]
44is 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
97The 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
You can’t perform that action at this time.
0 commit comments