-
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
fix ConstProp handling of written_only_inside_own_block_locals #102045
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
@@ -1066,32 +1066,32 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> { | |||
let source_info = terminator.source_info; | |||
self.source_info = Some(source_info); | |||
self.super_terminator(terminator, location); | |||
// Do NOT early return in this function, it does some crucial fixup of the state at the end! |
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.
we should probably put the non-fixup logic into a separate function that can then early return...
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.
There's a lot of refactoring that could be done here... by someone who actually understands that code.^^
(I also still haven't quite figured out what check_binary_op
actually checks and what its return value means. Few of the functions in this file have doc comments.)
@bors r+ |
@Mark-Simulacrum this should probably be backported. Should this PR be beta-nominated and then someone does the backporting, or should I open a backported PR? |
…, r=oli-obk fix ConstProp handling of written_only_inside_own_block_locals Fixes a regression introduced by rust-lang#100239, which adds an early return and thus skips some code in `visit_terminator` that must be run for soundness. Fixes rust-lang#101973
Rollup of 7 pull requests Successful merges: - rust-lang#89891 (`alloc`: add unstable cfg features `no_rc` and `no_sync`) - rust-lang#101995 (Add another example for `uN::carrying_mul`) - rust-lang#102031 (Adding ignore fuchsia tests for Backtrace, ErrorKind cases) - rust-lang#102041 (Improve `-Zmeta-stats` some more) - rust-lang#102045 (fix ConstProp handling of written_only_inside_own_block_locals) - rust-lang#102058 (Clarify Path::extension() semantics in docs abstract) - rust-lang#102059 (Use rebind instead of dummy binder in `SameTypeModuloInfer` relation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
[beta] backports * Avoid duplicating StorageLive in let-else rust-lang#101894 * Re-add HRTB implied static bug note rust-lang#101924 * Revert "Copy stage0 binaries into stage0-sysroot" rust-lang#101942 * implied_bounds: deal with inference vars rust-lang#102016 * fix ConstProp handling of written_only_inside_own_block_locals rust-lang#102045 * Fix wrongly refactored Lift impl rust-lang#102088 * Fix a typo “pararmeter” in error message rust-lang#102119 * Deny associated type bindings within associated type bindings rust-lang#102338 * Continue migration of CSS themes rust-lang#101934 * Fix search result colors rust-lang#102369 * Fix unwind drop glue for if-then scopes rust-lang#102394 * Revert "Use getentropy when possible on all Apple platforms" rust-lang#102693 * Fix associated type bindings with anon const in GAT position rust-lang#102336 * Revert perf-regression 101620 rust-lang#102064 * `EscapeAscii` is not an `ExactSizeIterator` rust-lang#99880
Fixes a regression introduced by #100239, which adds an early return and thus skips some code in
visit_terminator
that must be run for soundness.Fixes #101973