Uh oh!
There was an error while loading. Please reload this page.
Yet more rustc_mir_dataflow cleanups - #133155
Merged
bors merged 5 commits intoNov 27, 2024
Merged
Conversation
rustbot
commented
Nov 18, 2024
Collaborator
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
| const IS_BACKWARD: bool = !Self::IS_FORWARD; | ||
| fn apply_effects_in_block_and_join_state_into_successors_of<'mir, 'tcx, A>( |
ContributorAuthor
There was a problem hiding this comment.
Sure. I'll just use apply_effects_in_block, I think that's good enough.
cjgillot
commented
Nov 25, 2024
Contributor
Thanks. r=me with a naming nit |
They are always called in succession, so it's simpler if they are merged into a single function.
Describing some things that took me a long time to understand.
It is unnecessary.
In `MaybeRequiresStorage::apply_before_statement_effect`, call `transfer_function` directly, as is already done in `MaybeRequiresStorage::apply_before_terminator_effect`. This makes it clear that the operation doesn't rely on the `MaybeBorrowedLocals` results.
`ResultsCursor` currently owns its `Results`. But sometimes the `Results` is needed again afterwards. So there is `ResultsCursor::into_results` for extracting the `Results`, which leads to some awkwardness. This commit adds `ResultsHandle`, a `Cow`-like type that can either borrow or own a a `Results`. `ResultsCursor` now uses it. This is good because some `ResultsCursor`s really want to own their `Results`, while others just want to borrow it. We end with with a few more lines of code, but get some nice cleanups. - `ResultsCursor::into_results` and `Formatter::into_results` are removed. - `write_graphviz_results` now just borrows a `Results`, instead of the awkward "take ownership of a `Results` and then return it unchanged" pattern. This reinstates the cursor flexibility that was lost in rust-lang#118230 -- which removed the old `ResultsRefCursor` and `ResultsCloneCursor` types -- but in a much simpler way. Hooray!
nnethercoteforce-pushed
the
yet-more-rustc_mir_dataflow-cleanups
branch
from
November 26, 2024 00:30
a47e638 to
be7c6a3Comparennethercote
commented
Nov 26, 2024
ContributorAuthor
I updated the name. @bors r=cjgillot |
bors
commented
Nov 26, 2024
Collaborator
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 26, 2024
…mpiler-errors Rollup of 12 pull requests Successful merges: - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133155 (Yet more `rustc_mir_dataflow` cleanups) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 27, 2024
Rollup merge of rust-lang#133155 - nnethercote:yet-more-rustc_mir_dataflow-cleanups, r=cjgillot Yet more `rustc_mir_dataflow` cleanups A few more cleanups. r? `@cjgillot`
nnethercote added a commit
to nnethercote/rust
that referenced
this pull request
Dec 2, 2024
As of rust-lang#133155 `Formatter:new` uses `as_results_cursor` to create a non-mutable results reference, and then later that is accessed via `deref_mut` which results in a runtime abort. Changing to `as_results_cursor_mut` fixes it. Fixesrust-lang#133641.
github-actionsBot
pushed a commit
to tautschnig/verify-rust-std
that referenced
this pull request
Mar 11, 2025
…mpiler-errors Rollup of 12 pull requests Successful merges: - rust-lang#133042 (btree: add `{Entry,VacantEntry}::insert_entry`) - rust-lang#133070 (Lexer tweaks) - rust-lang#133136 (Support ranges in `<[T]>::get_many_mut()`) - rust-lang#133140 (Inline ExprPrecedence::order into Expr::precedence) - rust-lang#133155 (Yet more `rustc_mir_dataflow` cleanups) - rust-lang#133282 (Shorten the `MaybeUninit` `Debug` implementation) - rust-lang#133326 (Remove the `DefinitelyInitializedPlaces` analysis.) - rust-lang#133362 (No need to re-sort existential preds in relate impl) - rust-lang#133367 (Simplify array length mismatch error reporting (to not try to turn consts into target usizes)) - rust-lang#133394 (Bail on more errors in dyn ty lowering) - rust-lang#133410 (target check_consistency: ensure target feature string makes some basic sense) - rust-lang#133435 (miri: disable test_downgrade_observe test on macOS) r? `@ghost` `@rustbot` modify labels: rollup
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 freeto 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.
A few more cleanups.
r? @cjgillot