about summary refs log tree commit diff
path: root/src/librustc_parse/parser/diagnostics.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-03 10:19:58 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2019-12-20 22:41:28 +0100
commit52acaa69743be657f7d3003ca2a2abf7f1cd7a2e (patch)
tree1bea41c79d2879707293241e37ce5ce037a1fb97 /src/librustc_parse/parser/diagnostics.rs
parent903c9dfd1854d652dd5fb3e8c60231baeaec87bf (diff)
downloadrust-52acaa69743be657f7d3003ca2a2abf7f1cd7a2e.tar.gz
rust-52acaa69743be657f7d3003ca2a2abf7f1cd7a2e.zip
implement recovery in check_assoc_op
Diffstat (limited to 'src/librustc_parse/parser/diagnostics.rs')
-rw-r--r--src/librustc_parse/parser/diagnostics.rs18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index ba125cacab4..8b58fb03bf4 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -11,7 +11,7 @@ use syntax::ptr::P;
 use syntax::ThinVec;
 use syntax::util::parser::AssocOp;
 use syntax::struct_span_err;
-use syntax_pos::symbol::{kw, sym};
+use syntax_pos::symbol::kw;
 use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError};
 
 use log::{debug, trace};
@@ -312,22 +312,6 @@ impl<'a> Parser<'a> {
         };
         self.last_unexpected_token_span = Some(self.token.span);
         let mut err = self.fatal(&msg_exp);
-        if self.token.is_ident_named(sym::and) {
-            err.span_suggestion_short(
-                self.token.span,
-                "use `&&` instead of `and` for the boolean operator",
-                "&&".to_string(),
-                Applicability::MaybeIncorrect,
-            );
-        }
-        if self.token.is_ident_named(sym::or) {
-            err.span_suggestion_short(
-                self.token.span,
-                "use `||` instead of `or` for the boolean operator",
-                "||".to_string(),
-                Applicability::MaybeIncorrect,
-            );
-        }
         let sp = if self.token == token::Eof {
             // This is EOF; don't want to point at the following char, but rather the last token.
             self.prev_span