-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add #[loop_match]
for improved DFA codegen
#138780
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
Open
folkertdev
wants to merge
37
commits into
rust-lang:master
Choose a base branch
from
trifectatechfoundation:loop_match_attr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,445
−46
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
bbde3ad
Add `#[loop_match]` for improved DFA codegen
bjorn3 c661ab0
Apply suggestions from code review
folkertdev c20b782
add comments to tests
folkertdev 15a27b7
remove some comments that are now inaccurate
folkertdev 36564b1
static pattern matching when lowering `#[const_continue]`
folkertdev 1b3b076
clarify an unreachable branch
folkertdev baec2c7
add error for unknown jump target
folkertdev c93257d
emit an error when a match arm has a guard
folkertdev 5135e2f
store the span of the match expression, and use it for diagnostics
folkertdev c651ed8
add comments
folkertdev 25df14a
use `Size::truncate`
folkertdev 9540ef0
refactor `break_scope`
folkertdev 08829c6
Handle drop in unwind paths for #[const_continue]
bjorn3 0035816
fix comment
folkertdev a45c735
emit error when #[const_continue] jumps to an invalid label
folkertdev c77c0f0
delay most error handing until later
folkertdev f39fc20
Fix some comments
folkertdev 6685871
fix docs for `ConstContinuableScope`
folkertdev 83258e6
[WIP] Support const blocks in const_continue
bjorn3 8e060aa
Handle plain enum values
bjorn3 2559817
refactor valtree logic
folkertdev 6a97702
error on unsupported state type
folkertdev cfafa51
remove an unwrap
folkertdev cacba6b
use `span_bug` instead of `todo`
folkertdev 0eb5f8e
simplify logic for when a #[loop_match] state type is valid
folkertdev 9ef047b
support boolean and character patterns
folkertdev d8ea4b1
Apply suggestions from code review
folkertdev 7ec1ca3
support float patterns
folkertdev 44bcf8d
emit an error for constants that are too generic
folkertdev d7e6164
simplify thir visitor
folkertdev c3fa42d
add thir print test
folkertdev 58064fe
make the drop have a side-effect
folkertdev 856c6df
tweak a comment
folkertdev beb5f5c
Add assertion to loop-match/drop-in-march-arm.rs
bjorn3 d6cb6b6
add unstable book entry
folkertdev 5d84fca
accept macros inside the labeled block before the match
folkertdev c4b97f4
update tests after rebase
folkertdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have
const_continue
but noconst_loop_match
? is const loop match unnecessary for getting codegen improvements from the direct jumps with const continues?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only
const_continue
is needed (really because in rust you can't add more patterns to amatch
at runtime): the "const" part of the continue just makes sure that we know statically which arm of the match to jump to. Nothing special is needed from the loop.