-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Wrong matching with enums and overlapping ranges #13867
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
Labels
A-codegen
Area: Code generation
Comments
blocking #13831 |
Closed
cc me |
This seems to be a regression introduced by #13034. |
This is impacting #13896 as well. I had to add in guards that re-test the range to work around it. |
The defect of #13034 is that it doesn't check multiple refutable patterns, which is exactly what this bug report is about. |
edwardw
added a commit
to edwardw/rust
that referenced
this issue
May 5, 2014
It has been found that rust-lang#13034 was flawed and caused regression rust-lang#13867. This patch reveres the changes made by it except the companion tests.
edwardw
added a commit
to edwardw/rust
that referenced
this issue
May 5, 2014
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing rust-lang#12582 and rust-lang#13027 without causing regressions such as rust-lang#13867. Closes rust-lang#13867
bors
added a commit
that referenced
this issue
May 6, 2014
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing #12582 and #13027 without causing regressions such as #13867. Closes #13867
arcnmx
pushed a commit
to arcnmx/rust
that referenced
this issue
Jan 9, 2023
Fallback to invisible associated functions and constants if no visible resolutions are found Still lacking tests, will add those later Fixes rust-lang/rust-analyzer#13126
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs
Numeric a: Hex
. Clearly,a
shouldn't matchx
.Worth noting: if you change the first range to not include
x
, such asa
..w
, it works correctly. Also, removing the field fromAtoZ
also makes the match work correctly.The text was updated successfully, but these errors were encountered: