about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-18 18:34:35 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-08-24 21:32:48 +0200
commit6498959377421876040515af39b6491a2ec2a0c5 (patch)
tree2ef5b481ec392fba10c7b3e0350e65e2d9054342 /src/libsyntax/parse/parser
parentdc5bbaf7b2df8dc2be6c0f1a9973867e5519300b (diff)
downloadrust-6498959377421876040515af39b6491a2ec2a0c5.tar.gz
rust-6498959377421876040515af39b6491a2ec2a0c5.zip
parser: use `eat_or_separator` for leading vert.
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/pat.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs
index 14ac509d6f7..1063e347530 100644
--- a/src/libsyntax/parse/parser/pat.rs
+++ b/src/libsyntax/parse/parser/pat.rs
@@ -22,8 +22,8 @@ impl<'a> Parser<'a> {
 
     /// Parses patterns, separated by '|' s.
     pub(super) fn parse_pats(&mut self) -> PResult<'a, Vec<P<Pat>>> {
-        // Allow a '|' before the pats (RFC 1925 + RFC 2530)
-        self.eat(&token::BinOp(token::Or));
+        // Allow a '|' before the pats (RFCs 1925, 2530, and 2535).
+        self.eat_or_separator();
 
         let mut pats = Vec::new();
         loop {