Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an incorrect assumption #2606

Merged
merged 1 commit into from
May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions futures-util/src/stream/stream/flatten_unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ impl SharedPollState {
})
.ok()?;

debug_assert!(value & WAKING == NONE);

// Only start the waking process if we're not in the polling phase and the stream isn't woken already
if value & (WOKEN | POLLING) == NONE {
// Only start the waking process if we're not in the polling/waking phase and the stream isn't woken already
if value & (WOKEN | POLLING | WAKING) == NONE {
let bomb = PollStateBomb::new(self, SharedPollState::stop_waking);

Some((value, bomb))
Expand Down Expand Up @@ -236,7 +234,7 @@ impl ArcWake for WrappedWaker {
}

pin_project! {
/// Future which contains optional stream.
/// Future which polls optional inner stream.
///
/// If it's `Some`, it will attempt to call `poll_next` on it,
/// returning `Some((item, next_item_fut))` in case of `Poll::Ready(Some(...))`
Expand Down