Support bare unit structs in destructuring assignments

This commit is contained in:
Michael Goulet
2023-12-08 19:54:46 +00:00
parent ae612bedcb
commit d473bdfdc3
9 changed files with 42 additions and 24 deletions

View File

@@ -1084,6 +1084,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
| ExprKind::Struct(..)
| ExprKind::Tup(..)
| ExprKind::Underscore => false,
// Check for unit struct constructor.
ExprKind::Path(..) => lower_ctx.extract_unit_struct_path(lhs).is_none(),
// Check for tuple struct constructor.
ExprKind::Call(callee, ..) => lower_ctx.extract_tuple_struct_path(callee).is_none(),
ExprKind::Paren(e) => {