Skip to content

add scope! and extend! temporary scoping operators - #160297

Draft
dianne wants to merge 6 commits into
rust-lang:mainfrom
dianne:scope-extend-new
Draft

dianne wants to merge 6 commits into
rust-lang:mainfrom
dianne:scope-extend-new

Conversation

@dianne

@dianne dianne commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

This is my initial take on the scope! and extend! operators proposed by @traviscross. I've done a bit of interpretation; the exact semantics will need to be discussed. Part of rust-lang/goals#648, "Redesigning super let".

Diagnostics, documentation, splitting this PR up, this PR description, refining lints, and probably other things are all very much unfinished. The operators themselves seem to work just fine though! For how it looks in action, see the drop order test: temporary-rescoping.rs.

This is implemented on top of the (non-semantics-changing) refactor of temporary scoping I did as part of #146098. The first three commits are the tests and the refactor from that PR.

Since this experiment is meant to potentially replace super let statements, I'm piggy-backing off of the super_let tracking issue for now, but there's a new feature gate: temporary_rescoping, introduced in #166450.

Tracking issue for super let: #139076.

This PR is currently being split apart:

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 31, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added T-clippy Relevant to the Clippy team. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Nov 20, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@dianne
dianne force-pushed the scope-extend-new branch 2 times, most recently from 4b4880b to f4a61a5 Compare November 24, 2026 09:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants