pattern analysis: Store field indices in DeconstructedPat to avoid virtual wildcards#121820
Merged
bors merged 3 commits intorust-lang:masterfrom Mar 13, 2024
Merged
pattern analysis: Store field indices in DeconstructedPat to avoid virtual wildcards#121820bors merged 3 commits intorust-lang:masterfrom
DeconstructedPat to avoid virtual wildcards#121820bors merged 3 commits intorust-lang:masterfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Right now this is just `self.fields.len()` but that'll change in the next commit. `arity` will be useful for the `Debug` impl.
Member
Author
|
Ty! @bors r=@compiler-errors rollup |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 13, 2024
pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards
For a pattern like `Struct { field3: true, .. }`, in pattern analysis we represent it as `Struct { field1: _, field2: _, field3: true, field4: _ }`. This PR makes it so we store `Struct { field3: true, .. }` instead. This means we never have to create fake `_` patterns during lowering.
r? `@compiler-errors`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2024
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards) - rust-lang#121908 (match lowering: don't collect test alternatives ahead of time) - rust-lang#122203 (Add `intrinsic_name` to get plain intrinsic name) - rust-lang#122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`) - rust-lang#122255 (Use `min_exhaustive_patterns` in core & std) - rust-lang#122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors ) - rust-lang#122375 (CFI: Break tests into smaller files) - rust-lang#122383 (Enable PR tracking review assignment for rust-lang/rust) - rust-lang#122386 (Move `Once` implementations to `sys`) - rust-lang#122400 (Fix ICE in diagnostics for parenthesized type arguments) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2024
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards) - rust-lang#121908 (match lowering: don't collect test alternatives ahead of time) - rust-lang#122203 (Add `intrinsic_name` to get plain intrinsic name) - rust-lang#122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`) - rust-lang#122255 (Use `min_exhaustive_patterns` in core & std) - rust-lang#122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors ) - rust-lang#122383 (Enable PR tracking review assignment for rust-lang/rust) - rust-lang#122386 (Move `Once` implementations to `sys`) - rust-lang#122400 (Fix ICE in diagnostics for parenthesized type arguments) - rust-lang#122410 (rustdoc: do not preload fonts when browsing locally) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2024
Rollup merge of rust-lang#121820 - Nadrieril:idxpat2, r=compiler-errors pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards For a pattern like `Struct { field3: true, .. }`, in pattern analysis we represent it as `Struct { field1: _, field2: _, field3: true, field4: _ }`. This PR makes it so we store `Struct { field3: true, .. }` instead. This means we never have to create fake `_` patterns during lowering. r? ``@compiler-errors``
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 free
to 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.
For a pattern like
Struct { field3: true, .. }, in pattern analysis we represent it asStruct { field1: _, field2: _, field3: true, field4: _ }. This PR makes it so we storeStruct { field3: true, .. }instead. This means we never have to create fake_patterns during lowering.r? @compiler-errors