Skip to content

Clone .used upvars eagerly in non-move closures - #163885

Open
Jules-Bertholet wants to merge 1 commit into
rust-lang:mainfrom
Jules-Bertholet:use-closure-eager
Open

Jules-Bertholet wants to merge 1 commit into
rust-lang:mainfrom
Jules-Bertholet:use-closure-eager

Conversation

@Jules-Bertholet

@Jules-Bertholet Jules-Bertholet commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

By not keeping a reference to the capture, we extend the closure's lifetime.

This reverts #157270.

cc @joshtriplett, as the author of rust-lang/rfcs#3680

@rustbot label A-closures F-ergonomic_clones

Tracking issue: #132290

By not keeping a reference to the capture, we extend the closure's
lifetime.
@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 Oct 6, 2026
@rustbot

rustbot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

r? @hanna-kruppe

rustbot has assigned @hanna-kruppe.
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 77 candidates
  • Random selection from 19 candidates

@rustbot

rustbot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Error: Unknown labels: F-ergonomic-clones

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@rustbot rustbot added A-closures Area: Closures (`|…| { … }`) F-ergonomic_clones `#![feature(ergonomic_clones)]` labels Oct 6, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor

I'm not familiar with this lang experiment and don't know its current status or future prospects. People also expressed uncertainty about that in #157270. I can just re-roll (wouldn't be very qualified to review this anyway) but I wonder if we're beating a dead horse feature?

@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

r? @joshtriplett

@rustbot rustbot assigned joshtriplett and unassigned hanna-kruppe Oct 9, 2026
@rustbot

rustbot commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

joshtriplett is not on the review rotation at the moment.
They may take a while to respond.

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

A-closures Area: Closures (`|…| { … }`) F-ergonomic_clones `#![feature(ergonomic_clones)]` 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.

4 participants