Skip to content

compiler: Don't mark SingleUseConsts MIR pass as "required for soundness"#152729

Open
Enselic wants to merge 1 commit intorust-lang:mainfrom
Enselic:single_use_consts-not-required
Open

compiler: Don't mark SingleUseConsts MIR pass as "required for soundness"#152729
Enselic wants to merge 1 commit intorust-lang:mainfrom
Enselic:single_use_consts-not-required

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Feb 16, 2026

I don't think this MIR pass is required for soundness. The reasons are:

As shown in the updated test tests/mir-opt/optimize_none.rs, #[optimize(none)] functions become even less optimized, as expected and desired.

Unblocks #151426.

@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2026

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 Feb 16, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2026

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
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 68 candidates
  • Random selection from 14 candidates

@rust-log-analyzer

This comment has been minimized.

…dness"

Because:
* Something like it did not exist before PR 107404
* That it is not run our mir-opt-level 0 indicates that it is not
  required for soundness
* Its `MirPass::can_be_overridden()` is unchanged and thus returns true,
  indicating that it is not a required MIR pass.
* No test fails in PR 151426 that stops enabling by default in non-optimized builds

As can be seen from the updated test `tests/mir-opt/optimize_none.rs`,
this means that `#[optimize(none)]` functions become even less
optimized. As expected and as desired.
@Enselic Enselic force-pushed the single_use_consts-not-required branch from ef294be to 52b19f7 Compare February 17, 2026 05:22
@cjgillot
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 17, 2026

📌 Commit 52b19f7 has been approved by cjgillot

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants