1
Fork 0

Implement destructuring assignment for tuples

Co-authored-by: varkor <github@varkor.com>
This commit is contained in:
Fabian Zaiser 2020-11-04 16:32:52 +00:00
parent 601c13c6fd
commit 3a7a997323
23 changed files with 395 additions and 86 deletions

View file

@ -2531,6 +2531,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
hir_id,
kind: hir::PatKind::Binding(bm, hir_id, ident.with_span_pos(span), None),
span,
default_binding_modes: true,
}),
hir_id,
)
@ -2541,7 +2542,21 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
fn pat(&mut self, span: Span, kind: hir::PatKind<'hir>) -> &'hir hir::Pat<'hir> {
self.arena.alloc(hir::Pat { hir_id: self.next_id(), kind, span })
self.arena.alloc(hir::Pat {
hir_id: self.next_id(),
kind,
span,
default_binding_modes: true,
})
}
fn pat_without_dbm(&mut self, span: Span, kind: hir::PatKind<'hir>) -> &'hir hir::Pat<'hir> {
self.arena.alloc(hir::Pat {
hir_id: self.next_id(),
kind,
span,
default_binding_modes: false,
})
}
fn ty_path(