Summary
Implement and prototype two foundational improvements for ergonomic ref-counting: (1) a Share trait that semantically identifies types where cloning creates an alias to the same underlying value, and (2) move expressions (move($expr)) that allow precise control over what closures capture and when. These changes lay groundwork for future ergonomic improvements while delivering immediate value, with prototypes targeted for summer 2026.
Tasks and status
Note: we have updated the body to match the 2026 goal. Your original text is preserved below.
Details
Summary
Implement and prototype two foundational improvements for ergonomic ref-counting: (1) a Share trait that semantically identifies types where cloning creates an alias to the same underlying value, and (2) move expressions (move($expr)) that allow precise control over what closures capture and when. These changes lay groundwork for future ergonomic improvements while delivering immediate value, with prototypes targeted for summer 2026.
Needs contributor: This is a medium complexity problem. @nikomatsakis would like to mentor this goal with either an experienced contributor or a cohort of folks who know Rust but not the compiler. It is estimated that the goal will take about 6 months to implement for a cohort with minimal compiler hacking experience.
Tasks and status
Note: we have updated the body to match the 2026 goal. Your original text is preserved below.
Summary
We propose to write an alternative RFC for ergonomic ref-counting that makes lightweight cloning automatic and hold design meetings so the lang team can compare both approaches. This work builds on RFC #3680, which proposed a new keyword, use, that could be used with closures (use || ...) and expressions like x.use to help address a longstanding problem: working with ref-counted data structures like Arc<T> is verbose and confusing.
The 2025H1 work delivered .use syntax that works technically, but community feedback on the RFC pointed out a tension: if we're trying to improve ergonomics, why add more required syntax? We'll write an RFC exploring the automatic approach, complete the implementation work needed to support it, and run design meetings to help the lang team decide. This will tell us about the impact on user experience and performance, how well we can catch problematic cases, and which approach works better for Rust developers working with ref-counted data.
Tasks and status
Note: we have updated the body to match the 2025h2 goal. Your original text is preserved below.
Summary
- Deliver a nightly implementation of the experimental
use syntax for ergonomic ref-counting.
- RFC decision on the above
Tasks and status
Summary
Implement and prototype two foundational improvements for ergonomic ref-counting: (1) a
Sharetrait that semantically identifies types where cloning creates an alias to the same underlying value, and (2) move expressions (move($expr)) that allow precise control over what closures capture and when. These changes lay groundwork for future ergonomic improvements while delivering immediate value, with prototypes targeted for summer 2026.Tasks and status
Note: we have updated the body to match the 2026 goal. Your original text is preserved below.
Details
Summary
Implement and prototype two foundational improvements for ergonomic ref-counting: (1) a
Sharetrait that semantically identifies types where cloning creates an alias to the same underlying value, and (2) move expressions (move($expr)) that allow precise control over what closures capture and when. These changes lay groundwork for future ergonomic improvements while delivering immediate value, with prototypes targeted for summer 2026.Needs contributor: This is a medium complexity problem. @nikomatsakis would like to mentor this goal with either an experienced contributor or a cohort of folks who know Rust but not the compiler. It is estimated that the goal will take about 6 months to implement for a cohort with minimal compiler hacking experience.
Tasks and status
Note: we have updated the body to match the 2026 goal. Your original text is preserved below.
Summary
We propose to write an alternative RFC for ergonomic ref-counting that makes lightweight cloning automatic and hold design meetings so the lang team can compare both approaches. This work builds on RFC #3680, which proposed a new keyword,
use, that could be used with closures (use || ...) and expressions likex.useto help address a longstanding problem: working with ref-counted data structures likeArc<T>is verbose and confusing.The 2025H1 work delivered
.usesyntax that works technically, but community feedback on the RFC pointed out a tension: if we're trying to improve ergonomics, why add more required syntax? We'll write an RFC exploring the automatic approach, complete the implementation work needed to support it, and run design meetings to help the lang team decide. This will tell us about the impact on user experience and performance, how well we can catch problematic cases, and which approach works better for Rust developers working with ref-counted data.Tasks and status
Note: we have updated the body to match the 2025h2 goal. Your original text is preserved below.
Summary
usesyntax for ergonomic ref-counting.Tasks and status
x.useanduse ||syntax andUseClonedtrait (Ergonomic ref counting rust#134797).x.usewill do a copy ifX: Copyis true after monomorphization. Right now the desugaring tocloneoccurs before monomorphization and hence it will call theclonemethod even for those instances whereXis aCopytype.x.useto a move rather than a clone if this is a last-use.xequivalent tox.usebut with an (allow-by-default) lint to signal that something special is happened.