-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for move expressions (move(expr)) #155050
Copy link
Copy link
Open
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
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