You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IntoIter and ArrayVec need to be poisoned to prevent dropping before being drained; otherwise, if one of the elements panics on drop, it will be dropped twice. I've worked on a couple of solutions but they all have design tradeoffs so I figured I'd just let you fix it.
Drain doesn't have this issue because the ArrayVec's length is set to 0 when the Drain is initialized.
Fixed in version 0.3.10. Use (unstable) feature flag nodrop/no_drop_flag to recover size. (However, it's not completely equivalent in terms of overhead, even if the size is the same.)
Activity
Stebalien commentedon Aug 20, 2015
Test cases (abusing rust's panic on drop -> abort).
bluss commentedon Aug 20, 2015
Thanks! I guess this won't be easy..
Don't drop twice on panic.
Don't drop twice on panic.
Avoid double drop on panic bug
bluss commentedon Aug 20, 2015
For the lols, please read #5. Hey you said you would leave it for me to fix! But I do think you have the sane version, and I the insane..
Use NoDrop to fix panic safety issues
bluss commentedon Aug 21, 2015
Fixed in version 0.3.10. Use (unstable) feature flag nodrop/no_drop_flag to recover size. (However, it's not completely equivalent in terms of overhead, even if the size is the same.)
bluss commentedon Aug 21, 2015
Great, now it's fixed in smallvec too.