about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-02-04 23:28:58 +0800
committerGitHub <noreply@github.com>2018-02-04 23:28:58 +0800
commit1439c2ac35e2e2b03fdc336dc108865387565bd7 (patch)
treeaeae94e33bf1d93b052337495c5066416ac4bb29 /src/libsyntax/parse/parser.rs
parent8b8c6ee79613037e3a7886d1b80c34fcc538511b (diff)
parenta99b5db56a36652185a91be630b3e2af8ea09360 (diff)
downloadrust-1439c2ac35e2e2b03fdc336dc108865387565bd7.tar.gz
rust-1439c2ac35e2e2b03fdc336dc108865387565bd7.zip
Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov
Stabilize feature(match_beginning_vert)

With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm.

Reference PR: rust-lang-nursery/reference#231

Closes #44101
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b3c485a85c0..764b3d0a848 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3398,11 +3398,7 @@ impl<'a> Parser<'a> {
 
         let attrs = self.parse_outer_attributes()?;
         // Allow a '|' before the pats (RFC 1925)
-        let beginning_vert = if self.eat(&token::BinOp(token::Or)) {
-            Some(self.prev_span)
-        } else {
-            None
-        };
+        self.eat(&token::BinOp(token::Or));
         let pats = self.parse_pats()?;
         let guard = if self.eat_keyword(keywords::If) {
             Some(self.parse_expr()?)
@@ -3426,7 +3422,6 @@ impl<'a> Parser<'a> {
             pats,
             guard,
             body: expr,
-            beginning_vert,
         })
     }