Uh oh!
There was an error while loading. Please reload this page.
Change match desugaring to degenerate to if-else-if chains - #29776
Merged
Conversation
larsbergstrom
commented
Nov 11, 2015
Contributor
It would be great to land this ASAP, since this bug is blocking Servo's rustup :-) |
nrc
commented
Nov 11, 2015
Member
r+ with the typos fixed |
large matches that fallback to Eq. When we encounter a case where the test being performed does not inform the candidate at all, we just stop testing the candidates at that point, rather than adding the candidate to both outcomes. The former behavior was not WRONG, but it generated a lot of code, whereas this new behavior degenerates to an if-else-if tree. Fixesrust-lang#29740.
nikomatsakis
commented
Nov 11, 2015
ContributorAuthor
@bors r=nrc |
bors
commented
Nov 11, 2015
Collaborator
📌 Commit 662232c has been approved by |
nikomatsakis
commented
Nov 11, 2015
ContributorAuthor
@bors p=1 (blocking servo) |
bors
commented
Nov 11, 2015
Collaborator
⌛ Testing commit 662232c with merge b785ff9... |
bors
commented
Nov 11, 2015
Collaborator
💔 Test failed - auto-mac-64-opt |
bothered to track down for a regresson test. /me hopes no one notices
nikomatsakis
commented
Nov 11, 2015
ContributorAuthor
@bors r=nrc p=1 |
bors
commented
Nov 11, 2015
Collaborator
📌 Commit a5e3625 has been approved by |
bors
commented
Nov 12, 2015
Collaborator
⌛ Testing commit a5e3625 with merge 20f4e58... |
bors
commented
Nov 12, 2015
Collaborator
💔 Test failed - auto-mac-64-opt |
Manishearth added a commit
to Manishearth/rust
that referenced
this pull request
Nov 12, 2015
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to rust-lang#29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases. ~~Note that this builds on rust-lang#29763 which will hopefully land soon. So ignore the first few commits.~~ landed now r? @Aatch since he's been reviewing the other commits in this series
Manishearth added a commit
to Manishearth/rust
that referenced
this pull request
Nov 12, 2015
Manishearth
commented
Nov 12, 2015
Member
Fails tidy, needs Manishearth@4f65538 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring yet again to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.
Note that this builds on #29763 which will hopefully land soon. So ignore the first few commits.landed nowr? @Aatch since he's been reviewing the other commits in this series