Skip to content

Do not use desugared local names in tail_expr_drop_order diagnostics#157942

Open
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:issue-136206-tail-expr-drop-order-awaitee
Open

Do not use desugared local names in tail_expr_drop_order diagnostics#157942
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:issue-136206-tail-expr-drop-order-awaitee

Conversation

@qaijuang

@qaijuang qaijuang commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

tail_expr_drop_order labels values using names from body.var_debug_info.
That works for user-written bindings, but .await lowering also introduces a synthetic __awaitee binding for debuginfo. This can leak into the user-facing lint diagnostic.

This PR filters collected diagnostic names through LocalDecl::from_compiler_desugaring(), so compiler-generated locals fall back to the existing #N temporary labels. This does not change async lowering or the __awaitee debuginfo name itself.

A user-written binding named __awaitee is still treated as user-written and is still shown by name.

Fixes #136206

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 15, 2026
@qaijuang qaijuang marked this pull request as ready for review June 16, 2026 00:25
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 16, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
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
  • compiler expanded to 73 candidates
  • Random selection from 21 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.

tail_expr_drop_order lint can mention internal __awaitee name

3 participants