Skip to content

Move uninhabited unreachable code lint to rustc_mir_transform#157723

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cjgillot:late-uninhabited-lint
Jun 12, 2026
Merged

Move uninhabited unreachable code lint to rustc_mir_transform#157723
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cjgillot:late-uninhabited-lint

Conversation

@cjgillot

Copy link
Copy Markdown
Contributor

This method is post-processes the built MIR to remove uninhabited function return edges and linting over them. It does not use the rest of the MIR building infrastructure, and does not need to live in the same crate.

@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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 Jun 10, 2026
@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

r? @Kivooeo

rustbot has assigned @Kivooeo.
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 17 candidates

@saethlin

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

r? saethlin
r=me if perf is clean

@rust-timer

This comment has been minimized.

@rustbot rustbot assigned saethlin and unassigned Kivooeo Jun 11, 2026
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
Move uninhabited unreachable code lint to rustc_mir_transform
@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 832b2b0 (832b2b06b97538c018531f91c7d8e4fa82950d85, parent: 485ec3fbcc12fa14ef6596dabb125ad710499c9e)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (832b2b0): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -3.1%, secondary -2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
-2.3% [-2.4%, -2.3%] 2
All ❌✅ (primary) -3.1% [-3.1%, -3.1%] 1

Cycles

Results (secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 517.006s -> 515.816s (-0.23%)
Artifact size: 401.43 MiB -> 400.97 MiB (-0.11%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
@Kivooeo

Kivooeo commented Jun 11, 2026

Copy link
Copy Markdown
Member

@bors r=saethlin,Kivooeo rollup

@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3e5bae6 has been approved by saethlin,Kivooeo

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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 11, 2026
@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the late-uninhabited-lint branch from 3e5bae6 to ad797ab Compare June 12, 2026 00:26
@rustbot

This comment was marked as off-topic.

@cjgillot cjgillot force-pushed the late-uninhabited-lint branch from ad797ab to 08b1ff1 Compare June 12, 2026 00:27
@cjgillot

Copy link
Copy Markdown
Contributor Author

@bors r=saethlin,Kivooeo rollup

@rust-bors

rust-bors Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 08b1ff1 has been approved by saethlin,Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 12, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 12, 2026
Rollup of 24 pull requests

Successful merges:

 - #157716 (update Enzyme, June'26)
 - #149793 (Add inline asm support for amdgpu)
 - #155299 (make repr_transparent_non_zst_fields a hard error)
 - #157612 (Add a test where subtyping inhibits coercion.)
 - #157626 (Autogenerate unstable compiler flag stubs for unstable-book)
 - #157667 (Rename typing modes to better describe real usage)
 - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data)
 - #155113 (Ensure Send/Sync impl for std::process::CommandArgs)
 - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`)
 - #157342 (Reduce verbosity of cycle errors when possible)
 - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE)
 - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path)
 - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy)
 - #157698 (Remove an unnecessary cloning)
 - #157699 (Arg splat experiment - hir FnDecl impl)
 - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`)
 - #157722 (Move create_scope_map to rustc_codegen_ssa.)
 - #157723 (Move uninhabited unreachable code lint to rustc_mir_transform)
 - #157725 (Keep generic suggestion for macro-expanded missing-type items)
 - #157733 (Remove old FIXMEs about nocapture attribute)
 - #157737 (Reorganize `tests/ui/issues` [7/N])
 - #157746 (supports_c_variadic_definitions: extend checklist for new targets)
 - #157763 (Move unused target expression error to appropriate place and rename it)
 - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
@rust-bors rust-bors Bot merged commit 85102aa into rust-lang:main Jun 12, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 12, 2026
rust-timer added a commit that referenced this pull request Jun 12, 2026
Rollup merge of #157723 - cjgillot:late-uninhabited-lint, r=saethlin,Kivooeo

Move uninhabited unreachable code lint to rustc_mir_transform

This method is post-processes the built MIR to remove uninhabited function return edges and linting over them. It does not use the rest of the MIR building infrastructure, and does not need to live in the same crate.
@cjgillot cjgillot deleted the late-uninhabited-lint branch June 12, 2026 10:32
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