-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
A-expressionsTerm language related proposals & ideasTerm language related proposals & ideasA-syntaxSyntax related proposals & ideasSyntax related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
Given
struct Point { x: int, y: int }
fn returns_point(...) -> Point { ... }
fn returns_tuple(...) -> (int, int) { ... }
it would be nice to be able to do things like
let a; let b;
(a, b) = returns_tuple(...);
let c; let d;
Point { x: c, y: d } = returns_point(...);
and not just in let
s, as we currently allow.
Perhaps even:
let my_point: Point;
(my_point.x, my_point.y) = returns_tuple(...);
(Most use cases would likely involve mut
variables; but those examples would be longer.)
Related issues from the rust
repo: rust-lang/rust#10174 rust-lang/rust#12138
BlacklightShining, hayd, SirVer, oli-obk, dashed and 393 moreDavidSouthers97712, DarrienG, nuxlli, ArtAndreev, brooksmtownsend and 2 moredenisandroid, Frederik-Baetens and safinsinghideasman42, petro-rudenko, quininer, burjui, Object905 and 68 moreiorveth, scravy, mohe2015, s97712, egeyar and 3 moredzmitry-lahoda and scorphus
Metadata
Metadata
Assignees
Labels
A-expressionsTerm language related proposals & ideasTerm language related proposals & ideasA-syntaxSyntax related proposals & ideasSyntax related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.