about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorkeatinge <willy.keatinge@gmail.com>2018-01-06 15:22:29 -0500
committerkeatinge <willy.keatinge@gmail.com>2018-01-06 15:22:29 -0500
commita9b746bb2371a39d77bcea431415fa0a6ddca548 (patch)
treecf071fafaf0030e23fb6ab83568d8cc9ab47f0e7 /src/libsyntax/parse/parser.rs
parent8260209bb231cb92b1c9636ceded73f09edbc1c6 (diff)
downloadrust-a9b746bb2371a39d77bcea431415fa0a6ddca548.tar.gz
rust-a9b746bb2371a39d77bcea431415fa0a6ddca548.zip
Use span_suggestion instead of span_err_help
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 897f199f25e..adaa5670e80 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3433,9 +3433,9 @@ impl<'a> Parser<'a> {
             pats.push(self.parse_pat()?);
 
             if self.token == token::OrOr {
-                self.span_err_help(self.span,
-                                   "unexpected token `||` after pattern",
-                                   "did you mean to use `|` to specify multiple patterns?");
+                let mut err = self.struct_span_err(self.span, "unexpected token `||` after pattern");
+                err.span_suggestion(self.span, "use a single `|` to specify multiple patterns", "|".to_owned());
+                err.emit();
                 self.bump();
             } else if self.check(&token::BinOp(token::Or)) {
                 self.bump();