AsyncSequence, break, and cancellation

As an exercice, I have made several attempts at writing my own async sequence that wraps a Combine publisher.

When my async iterator subscribes with sink and stores the returned cancellable, I see no retain cycle, "breaking" an async loop deinits the iterator, and thus cancels the Combine subscription (this is the goal).

A similar variant is to instantiate a custom subscriber when the iterator is created, and have the iterator ask this subscriber to cancel the subscription when in iterator.deinit. That subscriber holds a weak reference to the iterator in order to avoid retain cycle. Again this setup gives the expected results.

However, as soon as the Iterator is also the Subscriber, then I witness a retain cycle that I can not break. The iterator, as a subscriber, is retained by the Combine subscription. As a consequence, it is not deallocated when async/await for loop drops its last reference to it, its deinit is not called, and the iterator can not trigger the subscription cancellation.