Skip to content

Mutable closure captures through opaque casts - #160150

Open
amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:fix-opaque-place
Open

Mutable closure captures through opaque casts#160150
amirHdev wants to merge 1 commit into
rust-lang:mainfrom
amirHdev:fix-opaque-place

Conversation

@amirHdev

@amirHdev amirHdev commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

fixes #160120
Preserve place semantics for opaque projections in closure captures instead of lowering them through ExprKind::Use and ensures mutable captures through TAIT opaque casts are validated by borrowck with both solvers

@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 Jul 29, 2026
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
@amirHdev
amirHdev marked this pull request as ready for review July 30, 2026 13:18
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in rustc_ty_utils::consts.rs

cc @BoxyUwU

Some changes occurred in match checking

cc @Nadrieril

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2026
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

r? @khyperia

rustbot has assigned @khyperia.
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 74 candidates
  • Random selection from 17 candidates

@khyperia

Copy link
Copy Markdown
Contributor

Would you mind describing a bit why a new THIR ExprKind is needed? This seems like it's a bug with the old solver, the new solver is able to error on this without requiring a new THIR node kind. How is it able to do so? Why is a new node kind needed for the old solver? If there's a good reason, do we want to only create this node kind if the old solver is in use?

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.

TAIT: ref mut destructuring does not require marking variable as mutable

4 participants