Skip to content

Bug in Chain-based future's implementations of FusedFuture #2118

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

Closed
Diggsey opened this issue Apr 6, 2020 · 2 comments
Closed

Bug in Chain-based future's implementations of FusedFuture #2118

Diggsey opened this issue Apr 6, 2020 · 2 comments
Labels
A-future Area: futures::future bug

Comments

@Diggsey
Copy link
Contributor

Diggsey commented Apr 6, 2020

return unsafe { Pin::new_unchecked(fut2) }.poll(cx);

As you can see, once the second future returns ready it will return immediately without first transitioning to the Empty state, which is what the is_terminated function looks at:

pub(crate)fn is_terminated(&self) -> bool {
if let Chain::Empty = *self { true } else { false }
}

@taiki-e
Copy link
Member

taiki-e commented Aug 29, 2020

I think this is fixed in #2128.

@Diggsey
Copy link
Contributor Author

Diggsey commented Aug 29, 2020

Yep.

@Diggsey Diggsey closed this as completed Aug 29, 2020
@taiki-e taiki-e added the bug label Oct 25, 2020
@taiki-e taiki-e added the A-future Area: futures::future label Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-future Area: futures::future bug
Projects
None yet
Development

No branches or pull requests

2 participants