Skip to content

Implement cromulent Copy closure captures - #163717

Draft
Jules-Bertholet wants to merge 7 commits into
rust-lang:mainfrom
Jules-Bertholet:cromulent-copy-closure-captures
Draft

Jules-Bertholet wants to merge 7 commits into
rust-lang:mainfrom
Jules-Bertholet:cromulent-copy-closure-captures

Conversation

@Jules-Bertholet

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

Copy link
Copy Markdown
Contributor

View all comments

Implements rust-lang/rfcs#4011.

Depends on #164014

Fixes #36569

@rustbot label T-lang A-closures needs-fcp S-blocked

@rustbot rustbot added 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. A-closures Area: Closures (`|…| { … }`) needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. T-lang Relevant to the language team labels Oct 3, 2026
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch 2 times, most recently from d0c48eb to 61b2dc2 Compare October 3, 2026 20:36
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Oct 3, 2026
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch from 61b2dc2 to 8cf8a71 Compare October 3, 2026 21:55
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch from 8cf8a71 to cc5b2e6 Compare October 3, 2026 22:40
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch 3 times, most recently from cdb0b2a to aa1f01a Compare October 4, 2026 04:24
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch 3 times, most recently from 40c8217 to 44bd89c Compare October 4, 2026 15:27
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch 3 times, most recently from 03e2c32 to 2a3a2e0 Compare October 4, 2026 19:20
@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch 2 times, most recently from 59ad213 to 818ec01 Compare October 4, 2026 21:42
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet
Jules-Bertholet force-pushed the cromulent-copy-closure-captures branch from 3d1ce2a to 61642b9 Compare October 19, 2026 21:06
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` labels Oct 19, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

A few of the Crater regressions appear to be from #164610. Most are from auto-trait inference (which I have now pushed a fix for).

@rust-bors

This comment has been minimized.

@theemathas

Copy link
Copy Markdown
Contributor

@bors try

@rust-bors

This comment has been minimized.

@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

@theemathas I resolved the merge conflict

@rust-bors

This comment has been minimized.

@theemathas

Copy link
Copy Markdown
Contributor

@bors try

The crater run should be of the crates that regressed in the previous run, right?

@rust-bors

This comment has been minimized.

@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

The crater run should be of the crates that regressed in the previous run, right?

Correct

@rust-bors

rust-bors Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 95f0840 (95f0840caffecee2d5a8b374e44806c3a0d50ca1)
Base parent: 1a2c479 (1a2c4797ef2570bd76ca5dee34449169bc7dc457)

@theemathas

Copy link
Copy Markdown
Contributor

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-163717-1 created and queued.
🤖 Automatically detected try build 95f0840
🔍 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

Copy link
Copy Markdown
Collaborator

🚧 Experiment pr-163717-1 is now running

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

@craterbot

Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-163717-1 is completed!
📊 48 regressed and 0 fixed (1227 total)
📊 245 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-163717-1/retry-regressed-list.txt ↩

@Jules-Bertholet

Jules-Bertholet commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

All the remaining regressions are from a single crate, https://github.com/robertknight/rten, with a for<'a> &'a T: Sync bound: https://github.com/robertknight/rten/blob/e20e3efbcc4cf941f211cc8d617a149da0c51533/src/ops/pooling.rs#L214

Thankfully, it's easy to accommodate this weirdness, though at the cost of some slightly uglier diagnostics.

So we now have 0 regressions 🎉

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-attributes Area: Attributes (`#[…]`, `#![…]`) A-closures Area: Closures (`|…| { … }`) A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. perf-regression Performance regression. S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Closures should infer to capture by copy

8 participants