Chain iterator adaptor shold drop exhausted subiterator #66031
Labels
A-iterators
Area: Iterators
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Consider the following program:
Currently, it deadlocks. It can be argued, however, that this program should finish, given that "equivalent" program without chain finishes:
I think this can be achieved by changing the
Chain
definition fromto
this will require some unsafe code to flip from
Both
toLeft
, using only&mut Both
, but should be doable.Context: I've discovered similarly-shaped code when trying to simplify this code. Basically, this is an event loop, which works on the stream of events, and some events can feed new events back into the loop. The goal is to make sure the loop is cleanly exhausted.
Not sure if this actually worth it, given super-obscure use-case and potential complications during implementation...
cc @bluss
The text was updated successfully, but these errors were encountered: