Repository navigation
Keep known_panics_lint values across single-predecessor assert edges - #164998
yashaggarwal85d wants to merge 2 commits into
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
rustbot has assigned @JonathanBrouwer. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment was marked as resolved.
This comment was marked as resolved.
|
Reopening after a conversation with the author |
|
@rustbot reroll |
|
As @yashaggarwal85d opened many PRs in a short amount of time and is relying on LLMs a lot, I will close this PR as I think the change is not something a new contributor opening many different PRs in different areas can have looked into deeply enough to actually understand. I don't want to put in the effort in understanding code you wrote with heavly LLM assistance |
KnownPanicsLint drops values of locals that are assigned more than once at the end of each block.
With overflow checks on,
x >>= nputs an assert before the shift, so the shift ends up in the nextblock and the lint loses
xright there. This keeps visiting into the assert/goto target when it hasonly one predecessor, and clears those locals once that chain ends.
Same applies to
/=and%=(div-by-zero assert), which were missed even with-O.Fixes #164191