-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
mir_build: Simplify length-determination and indexing for array/slice patterns #151103
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
Conversation
|
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras Some changes occurred in match lowering cc @Nadrieril |
|
rustbot has assigned @petrochenkov. Use |
|
Looks reasonable, r=me unless r? @Nadrieril wants to look. |
|
|
|
Looks reasonable! @bors r=Nadrieril,petrochenkov rollup |
…enkov mir_build: Simplify length-determination and indexing for array/slice patterns The existing length-determination code in `prefix_slice_suffix` has ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern. Pulling most of that step out into the `PatKind::Array` arm makes the whole thing a bit nicer overall. There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.
…enkov mir_build: Simplify length-determination and indexing for array/slice patterns The existing length-determination code in `prefix_slice_suffix` has ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern. Pulling most of that step out into the `PatKind::Array` arm makes the whole thing a bit nicer overall. There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.
…uwer Rollup of 12 pull requests Successful merges: - #150585 (Add a context-consistency check before emitting redundant generic-argument suggestions) - #150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items) - #150590 (Don't try to recover keyword as non-keyword identifier ) - #150817 (cleanup: remove borrowck handling for inline const patterns) - #150939 (resolve: Relax some asserts in glob overwriting and add tests) - #150966 (rustc_target: Remove unused Arch::PowerPC64LE) - #150971 (Disallow eii in statement position) - #151016 (fix: WASI threading regression by disabling pthread usage) - #151046 (compiler: Make Externally Implementable Item (eii) macros "semiopaque") - #151103 (mir_build: Simplify length-determination and indexing for array/slice patterns) - #151117 (Avoid serde dependency in build_helper when not necessary) - #151127 (Delete `MetaItemOrLitParser::Err`) r? @ghost
|
@bors try jobs=x86_64-gnu-llvm-21-3 |
This comment has been minimized.
This comment has been minimized.
mir_build: Simplify length-determination and indexing for array/slice patterns try-job: x86_64-gnu-llvm-21-3
|
@bors r- #151129 (comment) |
|
Commit a72083f has been unapproved. |
|
I'd say very unlikely that this affects anything but then again I don't see which other PR that could be. |
|
Seems like it might've been spurious, #150772 also failed |
|
Try job is green, so this PR should be unrelated to the failure. @bors r=Nadrieril,petrochenkov |
Rollup of 4 pull requests Successful merges: - #150846 (include `HirId`s directly in the THIR, not wrapped in `LintLevel`s) - #150979 (Avoid ICEs after bad patterns, for the other syntactic variants) - #151103 (mir_build: Simplify length-determination and indexing for array/slice patterns) - #151130 (resolve: Downgrade `ambiguous_glob_imports` to warn-by-default) r? @ghost
Rollup merge of #151103 - array-pat-len, r=Nadrieril,petrochenkov mir_build: Simplify length-determination and indexing for array/slice patterns The existing length-determination code in `prefix_slice_suffix` has ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern. Pulling most of that step out into the `PatKind::Array` arm makes the whole thing a bit nicer overall. There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.
The existing length-determination code in
prefix_slice_suffixhas ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern.Pulling most of that step out into the
PatKind::Arrayarm makes the whole thing a bit nicer overall.There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.