Skip to content

THIR pattern building: Move all thir::Pat creation into rustc_mir_build::thir::pattern - #150670

Merged
bors merged 1 commit into
rust-lang:mainfrom
Zalathar:let-ty
Jan 6, 2026
Merged

THIR pattern building: Move all thir::Pat creation into rustc_mir_build::thir::pattern#150670
bors merged 1 commit into
rust-lang:mainfrom
Zalathar:let-ty

Conversation

@Zalathar

Copy link
Copy Markdown
Member

The code in thir::cx::block was the only code outside of thir::pattern that created thir::Pat nodes.

Moving it makes the signature of pat_from_hir a bit messier, but ensures that all thir::Pat creation occurs in one module. That will be useful when trying to change thir::Pat, e.g. by adding fields to remove the need for wrapper nodes.

There should be no change to compiler output.

@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in match checking

cc @Nadrieril

@rustbotrustbot 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 Jan 4, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @WaffleLapkin

rustbot has assigned @WaffleLapkin.
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

Comment threadcompiler/rustc_mir_build/src/thir/cx/mod.rs Outdated
@Nadrieril

Copy link
Copy Markdown
Member

r? me

@rustbotrustbot assigned Nadrieril and unassigned WaffleLapkinJan 5, 2026
@Nadrieril

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

📌 Commit 304101f has been approved by Nadrieril

It is now in the queue for this repository.

@borsbors 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 Jan 5, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 6, 2026
THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`
The code in `thir::cx::block` was the only code outside of `thir::pattern` that created `thir::Pat` nodes.
Moving it makes the signature of `pat_from_hir` a bit messier, but ensures that all `thir::Pat` creation occurs in one module. That will be useful when trying to change `thir::Pat`, e.g. by adding fields to remove the need for wrapper nodes.
There should be no change to compiler output.
@ZalatharZalathar mentioned this pull request Jan 6, 2026
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 8 pull requests
Successful merges:
- #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
- #149880 (rustc_codegen_llvm: update alignment for double on AIX)
- #150668 (Unix implementation for stdio set/take/replace)
- #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
- #150695 (MGCA: pretty printing for struct expressions and tuple calls )
- #150698 (Improve comment clarity in candidate_may_shadow)
- #150706 (Update wasm-component-ld)
- #150710 (Update libc dependency of std)
r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 6, 2026
THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`
The code in `thir::cx::block` was the only code outside of `thir::pattern` that created `thir::Pat` nodes.
Moving it makes the signature of `pat_from_hir` a bit messier, but ensures that all `thir::Pat` creation occurs in one module. That will be useful when trying to change `thir::Pat`, e.g. by adding fields to remove the need for wrapper nodes.
There should be no change to compiler output.
@ZalatharZalathar mentioned this pull request Jan 6, 2026
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 8 pull requests
Successful merges:
- #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
- #149880 (rustc_codegen_llvm: update alignment for double on AIX)
- #150412 (use PIDFD_GET_INFO ioctl when available)
- #150668 (Unix implementation for stdio set/take/replace)
- #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
- #150695 (MGCA: pretty printing for struct expressions and tuple calls )
- #150698 (Improve comment clarity in candidate_may_shadow)
- #150706 (Update wasm-component-ld)
r? `@ghost`
`@rustbot` modify labels: rollup
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 6, 2026
THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`
The code in `thir::cx::block` was the only code outside of `thir::pattern` that created `thir::Pat` nodes.
Moving it makes the signature of `pat_from_hir` a bit messier, but ensures that all `thir::Pat` creation occurs in one module. That will be useful when trying to change `thir::Pat`, e.g. by adding fields to remove the need for wrapper nodes.
There should be no change to compiler output.
bors added a commit that referenced this pull request Jan 6, 2026
…uwer
Rollup of 11 pull requests
Successful merges:
- #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
- #148339 (naked functions: emit `.private_extern` on macos)
- #149880 (rustc_codegen_llvm: update alignment for double on AIX)
- #150122 (Refactor function names of `rustc_ast_lowering`)
- #150412 (use PIDFD_GET_INFO ioctl when available)
- #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
- #150695 (MGCA: pretty printing for struct expressions and tuple calls )
- #150698 (Improve comment clarity in candidate_may_shadow)
- #150706 (Update wasm-component-ld)
- #150707 (Fix ICE when transmute Assume field is invalid)
- #150708 (Enable merge queue in new bors)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 11 pull requests
Successful merges:
- #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
- #148339 (naked functions: emit `.private_extern` on macos)
- #149880 (rustc_codegen_llvm: update alignment for double on AIX)
- #150122 (Refactor function names of `rustc_ast_lowering`)
- #150412 (use PIDFD_GET_INFO ioctl when available)
- #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
- #150695 (MGCA: pretty printing for struct expressions and tuple calls )
- #150698 (Improve comment clarity in candidate_may_shadow)
- #150706 (Update wasm-component-ld)
- #150707 (Fix ICE when transmute Assume field is invalid)
- #150708 (Enable merge queue in new bors)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jan 6, 2026
…uwer
Rollup of 10 pull requests
Successful merges:
- #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
- #149880 (rustc_codegen_llvm: update alignment for double on AIX)
- #150122 (Refactor function names of `rustc_ast_lowering`)
- #150412 (use PIDFD_GET_INFO ioctl when available)
- #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
- #150695 (MGCA: pretty printing for struct expressions and tuple calls )
- #150698 (Improve comment clarity in candidate_may_shadow)
- #150706 (Update wasm-component-ld)
- #150707 (Fix ICE when transmute Assume field is invalid)
- #150708 (Enable merge queue in new bors)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit ce42a61 into rust-lang:mainJan 6, 2026
11 checks passed
@rustbotrustbot added this to the 1.94.0 milestone Jan 6, 2026
rust-timer added a commit that referenced this pull request Jan 6, 2026
Rollup merge of #150670 - Zalathar:let-ty, r=Nadrieril
THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`
The code in `thir::cx::block` was the only code outside of `thir::pattern` that created `thir::Pat` nodes.
Moving it makes the signature of `pat_from_hir` a bit messier, but ensures that all `thir::Pat` creation occurs in one module. That will be useful when trying to change `thir::Pat`, e.g. by adding fields to remove the need for wrapper nodes.
There should be no change to compiler output.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

@Zalathar@rustbot@Nadrieril@bors@WaffleLapkin