Skip to content

Document cancel safety of StreamExt::next - #3043

Open
ChrisJr404 wants to merge 1 commit into
rust-lang:mainfrom
ChrisJr404:docs-next-cancel-safety
Open

Document cancel safety of StreamExt::next#3043
ChrisJr404 wants to merge 1 commit into
rust-lang:mainfrom
ChrisJr404:docs-next-cancel-safety

Conversation

@ChrisJr404

Copy link
Copy Markdown

Adds a cancel safety section to StreamExt::next documenting that dropping the returned future before it completes does not remove an item from the stream, so it is safe to use in a select! branch. Closes #2701, where taiki-e said a PR to document this would be accepted.

@rustbot rustbot added A-stream Area: futures::stream S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-stream Area: futures::stream S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document cancel safety of StreamExt::next

2 participants