about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-11-09 01:13:44 +0100
committerGitHub <noreply@github.com>2020-11-09 01:13:44 +0100
commitabaa78baeb456d1517c94013ecf125c5dff83731 (patch)
treec583006cc9d3e7684f8aab62303e67cf00b61934 /compiler/rustc_codegen_llvm/src
parentb4589a86ccdd39114c887eb5785c8493fc421162 (diff)
parent3a7a997323436ecf255c39898667320935445f62 (diff)
downloadrust-abaa78baeb456d1517c94013ecf125c5dff83731.tar.gz
rust-abaa78baeb456d1517c94013ecf125c5dff83731.zip
Rollup merge of #78748 - fanzier:tuple-assignment, r=petrochenkov
Implement destructuring assignment for tuples

This is the first step towards implementing destructuring assignment (RFC: https://github.com/rust-lang/rfcs/pull/2909, tracking issue: #71126). This PR is the first part of #71156, which was split up to allow for easier review.

Quick summary: This change allows destructuring the LHS of an assignment if it's a (possibly nested) tuple.
It is implemented via a desugaring (AST -> HIR lowering) as follows:
```rust
(a,b) = (1,2)
```
... becomes ...
```rust
{
  let (lhs0,lhs1) = (1,2);
  a = lhs0;
  b = lhs1;
}
```

Thanks to `@varkor` who helped with the implementation, particularly around default binding modes.

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions