This is a tracking issue for move(expr) in closures.
The feature gate for the issue is #![feature(move_expr)].
An RFC is expected to be created later.
Relevant prior discussion / implementation PR: #132290.
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.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Summary
move_expr adds syntax of the form move(expr) for explicit by-value capture in closures.
The current implementation effort is intentionally starting with plain closures first.
Async / coroutine-related cases are expected to follow separately.
Steps
Unresolved Questions
Implementation history
This is a tracking issue for
move(expr)in closures.The feature gate for the issue is
#![feature(move_expr)].An RFC is expected to be created later.
Relevant prior discussion / implementation PR: #132290.
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.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Summary
move_expradds syntax of the formmove(expr)for explicit by-value capture in closures.The current implementation effort is intentionally starting with plain closures first.
Async / coroutine-related cases are expected to follow separately.
Steps
move_exprmove(expr)for plain closures Introduce move expressions (move($expr)) #155023rustfmtUnresolved Questions
move(expr)interact with expressions likebreak, where the desugaring evaluates the expression at closure creation time?Implementation history
move($expr)) #155023