-
Notifications
You must be signed in to change notification settings - Fork 13.3k
slice pattern bug #24875
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I'm actually seeing similar behavior even without guards (rest pattern overriding an earlier fixed-arity pattern). |
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Jul 15, 2015
The old code was not well structured, difficult to understand, and buggy. The new implementation is completely naive, so there may be a slight runtime performance loss. That said, adding optimizations on top of a clear and correct implementation seems easier than trying to fix the old mess. Fixes issue rust-lang#19064. Fixes issue rust-lang#26989. Fixes issue rust-lang#26251. Fixes issue rust-lang#18060. Fixes issue rust-lang#24875. Fixes issue rust-lang#23311. Fixes issue rust-lang#20046.
Seems to be working as expected now: https://play.rust-lang.org/?gist=2de1a5847481016cfe1909c6b24634f9&version=nightly&backtrace=0 |
Sure. Bug never existed in MIR. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
The following program prints 102. Commenting out the match arm for either 100 or 102 causes the correct value (101) to be printed. I believe the first and third cases are being merged as they have the same form (but different guards), ruining the priority.
The text was updated successfully, but these errors were encountered: