Skip to content

mir_build: Rename lower_let_expr to lower_fallible_let, and clarify - #162468

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:fallible-let
Sep 8, 2026
Merged

mir_build: Rename lower_let_expr to lower_fallible_let, and clarify#162468
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:fallible-let

Conversation

@Zalathar

@Zalathar Zalathar commented Sep 8, 2026

Copy link
Copy Markdown
Member

Calling this method lower_let_expr is misleading, as it is also used for lowering let-else statements, which don't contain a thir::ExprKind::Let.

This PR also:

  • Rewords some related comments.
  • Renames the method's expr parameter to the less-misleading scrutinee_id, since this parameter is the RHS expression being inspected.
  • Reorders the pat and scrutinee_id parameters to match their order in normal Rust syntax.
  • Renames the success/failure blocks to true_block and false_block, to match the convention used by mir_build: Clarify parts of if-condition lowering #161861.

There should be no change to compiler behaviour.

@rustbot

rustbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in match lowering

cc @Nadrieril

@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 Sep 8, 2026
@rustbot

rustbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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
  • compiler, mir expanded to 75 candidates
  • Random selection from 20 candidates

@dianne

dianne commented Sep 8, 2026

Copy link
Copy Markdown
Member

lower_fallible_let is definitely a better name, and I like the clarifications. I could maybe go either way on the argument ordering, depending on whether we want to consistently order arguments in a particular way or match surface-level syntax, but I think I like matching surface-level syntax a bit more.

r? me
@bors r+

@rust-bors

rust-bors Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 13f707f has been approved by dianne

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious failures

@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 Sep 8, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 8, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #162462 (Fix unsoundness in `VecDeque::from_iter(vec::IntoIter)`)
 - #162468 (mir_build: Rename `lower_let_expr` to `lower_fallible_let`, and clarify)
 - #161806 (Add tests and docs for `#[derive(GenericTypeVisitable)]`)
 - #161912 (run `extern "tail"` with `byval` argument test)
 - #161932 (Only check `#[allow(dead_code)]` on the trait)
 - #162236 (Call renumberMetadataForAssembly() in LLVMRustPrintModule())
 - #162435 (windows-gnu: document libgcc requirement)
 - #162439 (Update books)
 - #162451 (Add regression test for item-local diagnostic attribute lint levels)
 - #162455 (Update codegen-llvm/inline-debuginfo.rs for distinct DILocation)
 - #162459 (docs(time): replace "method" with "function")
 - #162465 (Fix my duplicate thanks entry)
@rust-bors
rust-bors Bot merged commit ea9dbb3 into rust-lang:main Sep 8, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 8, 2026
Rollup merge of #162468 - Zalathar:fallible-let, r=dianne

mir_build: Rename `lower_let_expr` to `lower_fallible_let`, and clarify

Calling this method `lower_let_expr` is misleading, as it is also used for lowering let-else statements, which don't contain a `thir::ExprKind::Let`.

This PR also:
- Rewords some related comments.
- Renames the method's `expr` parameter to the less-misleading `scrutinee_id`, since this parameter is the RHS expression being inspected.
- Reorders the `pat` and `scrutinee_id` parameters to match their order in normal Rust syntax.
- Renames the success/failure blocks to `true_block` and `false_block`, to match the convention used by #161861.

There should be no change to compiler behaviour.
@Zalathar
Zalathar deleted the fallible-let branch September 9, 2026 01:12
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.

4 participants