Skip to content

Clarify the role of the PreCodegen dummy pass#156358

Open
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:pre-codegen
Open

Clarify the role of the PreCodegen dummy pass#156358
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:pre-codegen

Conversation

@Zalathar
Copy link
Copy Markdown
Member

@Zalathar Zalathar commented May 9, 2026

The existing comments for this pass are somewhat confusing.

The PreCodegen pass does nothing by itself. It exists so that -Zdump-mir (and mir-opt tests) can easily dump the final pre-codegen MIR, by dumping the input or output of PreCodegen, which happens to be run after all other passes are finished.

Zalathar added 2 commits May 9, 2026 22:06
This function doesn't have an obvious home, but there's little reason for it to
be in `rustc_mir_transform`, and having it in `rustc_driver_impl::pretty` at
least puts it near other callers of `write_mir_pretty`.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 9, 2026

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 9, 2026

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, mir, mir-opt
  • compiler, mir, mir-opt expanded to 73 candidates
  • Random selection from 18 candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants