-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Preliminary cleanup of WitnessPat
hoisting/printing
#128536
Merged
Merged
Conversation
This file contains 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
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Aug 2, 2024
Some changes occurred in exhaustiveness checking cc @Nadrieril |
Zalathar
force-pushed
the
print-cleanup
branch
4 times, most recently
from
August 4, 2024 01:39
1c3fdb1
to
9969b1d
Compare
Nadrieril
requested changes
Aug 7, 2024
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.
This was very pleasant to review, tyvm!
rustbot
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Aug 7, 2024
(Rebased before addressing feedback; no changes yet.) |
We can replace some tricky iterator-mutation code with a much simpler version that uses `while let` to shrink a slice. We also check whether a subpattern would be a wildcard _before_ hoisting it, which will be very useful when trying to get rid of `print::PatKind` later.
Addressed feedback (diff). |
Nadrieril
approved these changes
Aug 10, 2024
Ty! @bors r+ |
bors
removed
the
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
Aug 10, 2024
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Aug 10, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Aug 11, 2024
Preliminary cleanup of `WitnessPat` hoisting/printing Follow-up to rust-lang#128430. The eventual goal is to remove `print::Pat` entirely, but in the course of working towards that I made so many small improvements that it seems wise to let those be reviewed/merged on their own first. Best reviewed commit-by-commit, most of which should be pretty simple and straightforward. r? `@Nadrieril`
This was referenced Aug 11, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 11, 2024
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#120314 (core: optimise Debug impl for ascii::Char) - rust-lang#128536 (Preliminary cleanup of `WitnessPat` hoisting/printing) - rust-lang#128592 (Promote aarch64-apple-darwin to Tier 1) - rust-lang#128762 (Use more slice patterns inside the compiler) - rust-lang#128875 (rm `import.used`) - rust-lang#128882 (make LocalWaker::will_wake consistent with Waker::will_wake) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 11, 2024
Rollup merge of rust-lang#128536 - Zalathar:print-cleanup, r=Nadrieril Preliminary cleanup of `WitnessPat` hoisting/printing Follow-up to rust-lang#128430. The eventual goal is to remove `print::Pat` entirely, but in the course of working towards that I made so many small improvements that it seems wise to let those be reviewed/merged on their own first. Best reviewed commit-by-commit, most of which should be pretty simple and straightforward. r? ``@Nadrieril``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 11, 2024
Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in rust-lang#128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? `@Nadrieril`
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Aug 16, 2024
Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in rust-lang#128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? `@Nadrieril`
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Aug 16, 2024
Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in rust-lang#128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? ``@Nadrieril``
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Aug 16, 2024
Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in rust-lang#128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? ```@Nadrieril```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 16, 2024
Rollup merge of rust-lang#128965 - Zalathar:no-pat, r=Nadrieril Remove `print::Pat` from the printing of `WitnessPat` After the preliminary work done in rust-lang#128536, we can now get rid of `print::Pat` entirely. - First, we introduce a variant `PatKind::Print(String)`. - Then we incrementally remove each other variant of `PatKind`, by having the relevant code produce `PatKind::Print` instead. - Once `PatKind::Print` is the only remaining variant, it becomes easy to remove `print::Pat` and replace it with `String`. There is more cleanup that I have in mind, but this seemed like a natural stopping point for one PR. r? ```@Nadrieril```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Follow-up to #128430.
The eventual goal is to remove
print::Pat
entirely, but in the course of working towards that I made so many small improvements that it seems wise to let those be reviewed/merged on their own first.Best reviewed commit-by-commit, most of which should be pretty simple and straightforward.
r? @Nadrieril