Skip to content

fix drop scope for super let bindings within if let #145342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dianne
Copy link
Contributor

@dianne dianne commented Aug 13, 2025

Fixes #145328 by making non-lifetime-extended super let reuse the logic used to compute drop scopes for non-lifetime-extended temporaries.

Tracking issue for super let: #139076

This is a regression fix / breaking change for macros stably exposing super let, including pin!.
Nominating to be discussed alongside #145328: @rustbot label +I-lang-nominated +I-libs-api-nominated

dianne added 2 commits August 13, 2025 01:38
They now use the enclosing temporary scope as their scope, regardless of
which `ScopeData` was used to mark it.
@rustbot
Copy link
Collaborator

rustbot commented Aug 13, 2025

r? @jackh726

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

@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. I-lang-nominated Nominated for discussion during a lang team meeting. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. labels Aug 13, 2025
@traviscross traviscross added P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang P-lang-drag-0 Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang. and removed P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Aug 13, 2025
@compiler-errors
Copy link
Member

@dianne does this need crater?

@traviscross
Copy link
Contributor

traviscross commented Aug 13, 2025

@bors2 try

@craterbot

This comment was marked as resolved.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 13, 2025
fix drop scope for `super let` bindings within `if let`
@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

☀️ Try build successful (CI)
Build commit: a498031 (a4980311fb7bb9e7893708e6bd3fbbfb2819fd3d, parent: 350d0ef0ec0493e6d21cfb265cb8211a0e74d766)

@compiler-errors
Copy link
Member

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-145342 created and queued.
🤖 Automatically detected try build a498031
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-lang-nominated Nominated for discussion during a lang team meeting. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. P-lang-drag-0 Lang team prioritization drag level 0.https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang. S-waiting-on-crater Status: Waiting on a crater run to be completed. 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.

pin!() has incorrect/unexpected drop order inside if-let.
6 participants