Repository: rust
Issue: Tracking Issue for #![feature(async_iterator)]
Labels: T-lang,T-libs-api,C-tracking-issue,A-async-await,AsyncAwait-Triaged,Libs-Tracked,WG-async

<!--
Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
feature from implementation to stabilisation. Make sure to include the relevant
RFC for the feature if it has one. Otherwise provide a short summary of the
feature and link any relevant PRs or issues, and remove any sections that are
not relevant to the feature.

Remember to add team labels to the tracking issue.
For a language team feature, this would e.g., be `T-lang`.
Such a feature should also be labeled with e.g., `F-my_feature`.
This label is used to associate issues (e.g., bugs and design questions) to the feature.
-->

This is a tracking issue for the RFC "2996" (rust-lang/rfcs#2996).
The feature gate for the issue is `#![feature(async_iterator)]`.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->

- [x] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
      instructions?)
- [x] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions
- [ ] Clarify the panic behavior of `Stream` and `Iterator` https://github.com/rust-lang/rust/pull/79023#discussion_r538975223
    - [ ] Add a panic section to `Iterator`, clarifying panic behavior. The panic behavior between `Stream` and `Iterator` should be consistent.
- [ ] Restore `Stream::next`. This was removed from the RFC because it prevents dynamic dispatch, and subsequently removed from the implementation. This should be resolved before stabilizing.
    - [ ] Investigate whether we can move the trait from `fn poll_next` to `async fn next` once we can use `async` in traits.
- [ ] Investigate as part of [keyword-generics](https://github.com/rust-lang/keyword-generics-initiative) whether we can merge `Iterator` and `AsyncIterator` into a single trait which is generic over "asyncness".
- [x] Should we name this API `AsyncIterator` instead? https://github.com/rust-lang/rust/issues/79024#issuecomment-816868752

### Implementation history
- [PR introducing `core::stream::{Stream, Next}`](https://github.com/rust-lang/rust/pull/79023)
- [Rename from `Stream` to `AsyncIterator`](https://github.com/rust-lang/rust/pull/93613)