FuturesUnordered: fix partial iteration by wfraser · Pull Request #2574 · rust-l...
source link: https://github.com/rust-lang/futures-rs/pull/2574
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The IntoIter impl advances the head pointer every iteration, but this breaks the linked list invariant that the head's prev should be null.
If the iteration is not done to completion (which sets head to null), on subsequent drop, FuturesUnordered::unlink relies on this broken invariant and ends up panicking.
The fix is to maintain the head->prev == null
invariant while iterating.
Fixes #2573
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK