Skip to content

Check for comparisons to NaN in patterns #8029

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 3 commits into from

Conversation

emillon
Copy link
Contributor

@emillon emillon commented Jul 24, 2013

Hi,

As noted in #6804, a pattern that contains NaN will never match because NaN != NaN. This adds a warning for such a case. The first commit handles the basic case and the second one generalizes it to more complex patterns using walk_pat.

@emillon
Copy link
Contributor Author

emillon commented Jul 25, 2013

@cmr Thanks. I fixed the warning message.

bors added a commit that referenced this pull request Jul 25, 2013
Hi,

As noted in #6804, a pattern that contains `NaN` will never match because `NaN != NaN`. This adds a warning for such a case. The first commit handles the basic case and the second one generalizes it to more complex patterns using `walk_pat`.
@bors bors closed this Jul 25, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 21, 2022
…_structs-OnNonExhaustive, r=Manishearth

Do not trigger ``[`rest_pat_in_fully_bound_structs`]`` on `#[non_exhaustive]` structs

fixes rust-lang#8029

Just adds an additional check to ensure that the`ty::VariantDef` is not marked as `#[non_exhaustive]`.

changelog: Do not apply ``[`rest_pat_in_fully_bound_structs`]`` on structs marked as non exhaustive.
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