Repository navigation
Const analysis cleanups - #163529
Merged
Merged
Const analysis cleanups#163529
Conversation
It has a single call site, where it can be replaced with `insert_value_idx` because `flood_discr` and `find_discr` are already done.
It's basically the same as `Option::and_then`.
`handle_assign` handles several `Rvalue` variants, and then falls through to the only call site of `handle_rvalue`, which handles all the `Rvalue` variants. The `Use`, `CopyForDeref`, and `Aggregate` arms in `handle_rvalue` are unreachable because those variants are fully handled by `handle_assign` This commit just inlines and removes `handle_rvalue`, which makes the control flow simpler and avoids the unreachable arms.
These all have a single call site and are tiny or small, and several are called from methods that are also tiny. (Too many small methods just spreads things out unnecessarily.) The only remaining `handle_*` methods are `handle_assign`, which is large, and `handle_operand`, which has multiple call sites.
Collaborator
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Contributor
Author
|
LLM disclosure: some of these changes were identified by an LLM. I made all the code and text changes myself. |
Member
|
Neat. Thanks for doing things like this, especially trimming down mutability and visibility. @bors r+ |
Contributor
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.
Details in individual commits.
r? @saethlin