-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
const_prop_lint: Consider array length constant even if array is not #100160
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? oli-obk cc @JakobDegen |
r? @oli-obk |
@@ -501,12 +501,23 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { | |||
return None; | |||
} | |||
|
|||
Rvalue::Len(len_place) => { |
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.
I think we should make the same change in the const_prop
pass as well:
| Rvalue::Len(..) |
but that doesn't have to be in this PR 🙂
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.
afaicr this is not necessary, because there are optimizations taking care of this before const prop runs
@bors r+ rollup |
…nt, r=oli-obk const_prop_lint: Consider array length constant even if array is not Fixes rust-lang#98444.
Failed in rollup: #101016 (comment) |
e4a4246
to
d5c9e76
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Ping from triage: |
☔ The latest upstream changes (presumably #102091) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #98444.