Skip to content

Fix Acceptor Iterator #9089

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
wants to merge 1 commit into from
Closed

Conversation

anasazi
Copy link
Contributor

@anasazi anasazi commented Sep 9, 2013

The iterator over incoming connections has no natural end, so it should always return Some(_).
Currently, if an incoming connection fails, the iterator returns None.
Trying to accept another connection afterwards enters the realm of undefined behavior (due to the iterator protocol being silent on the issue).

This PR changes wraps the underlying accept call in Some, so the iterator never finishes.

bors added a commit that referenced this pull request Sep 9, 2013
The iterator over incoming connections has no natural end, so it should always return Some(_).
Currently, if an incoming connection fails, the iterator returns None.
Trying to accept another connection afterwards enters the realm of undefined behavior (due to the iterator protocol being silent on the issue).

This PR changes wraps the underlying accept call in Some, so the iterator never finishes.
@bors bors closed this Sep 10, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 18, 2022
Fix ICE in `dereference.rs`

fixes rust-lang#9089
changelog: Fix ICE when dereferencing or borrowing on explicit returns from closures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants