-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correctly drop Array::IntoIter (#1773)
* correctly drop Array::IntoIter If you called Array::into_iter() you could leak elements in two circumstances: 1. If you did not iterate through all elements before dropping, since they had been converted to `ManuallyDrop` 2. If the Array had multiple references when the iterator was created, but the other references were dropped before the iterator was dropped, then the existence of the iterator would prevent those Rcs from dropping their contents, but then because the iterator is of type ManuallyDrop, it wouldn't drop those elements either * eta reduction Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io> * update comments and fix eta-reduction error --------- Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
- Loading branch information
Showing
1 changed file
with
52 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters