Open
Description
This is a tracking issue for ergonomic reference counting, including:
- Simplify lightweight clones, including into closures and async blocks rfcs#3680
- Experiment with ergonomic ref-counting rust-project-goals#107
...and other work.
The feature gate for this issue is #![feature(ergonomic_clones)]
.
About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Approve as lang experiment.
- Modify the MIR building to create a customer terminator for "use" that selects between copy/clone/move post-monorphization
- Add tests and support for const use closures
- Resolve Test interaction between RFC 2229 migration and
use
closures #138101 - Accept an RFC.
- Implement in nightly.
- Finalize opsem (What is the operational spec for
use
expressions? unsafe-code-guidelines#564) - Add documentation to the dev guide.
- See the instructions.
- Add documentation to the reference.
- See the instructions.
- Add formatting for new syntax to the style guide.
- See the nightly style procedure.
- Stabilize.
- See the instructions.
Unresolved Questions
- Name of
UseCloned
trait which signalsx.use
toclone
- Precise set of
UseCloned
impls -- in particular any blanket impls we ought to be concerned about? - should
x.use
work on!Clone
types? Currently the impl just generates a move
Related
cc @spastorino @jkelleyrtp @rust-lang/lang