From 8640a51ff8d580bbb87aa3dc0ff8bacbad111010 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 24 Feb 2018 03:12:35 +0300 Subject: Implement multiple patterns with `|` in `if let` and `while let` --- src/libsyntax/ast.rs | 4 ++-- src/libsyntax/feature_gate.rs | 9 +++++++++ src/libsyntax/fold.rs | 8 ++++---- src/libsyntax/parse/parser.rs | 8 ++++---- src/libsyntax/print/pprust.rs | 41 +++++++++++++++++++++++------------------ src/libsyntax/visit.rs | 8 ++++---- 6 files changed, 46 insertions(+), 32 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index c7ce7fffaa2..6609b77b132 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1085,7 +1085,7 @@ pub enum ExprKind { /// `if let pat = expr { block } else { expr }` /// /// This is desugared to a `match` expression. - IfLet(P, P, P, Option>), + IfLet(Vec>, P, P, Option>), /// A while loop, with an optional label /// /// `'label: while expr { block }` @@ -1095,7 +1095,7 @@ pub enum ExprKind { /// `'label: while let pat = expr { block }` /// /// This is desugared to a combination of `loop` and `match` expressions. - WhileLet(P, P, P, Option