]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/diagnostics.rs
Remove GlobalArenas and use Arena instead
[rust.git] / src / libsyntax / parse / diagnostics.rs
index 9431b559da55ff8c54d8e012c31eab8ca81b3067..b3d49524d7668599e9d37ed6d46907db65981776 100644 (file)
@@ -8,7 +8,7 @@
 use crate::print::pprust;
 use crate::ptr::P;
 use crate::source_map::Spanned;
-use crate::symbol::kw;
+use crate::symbol::{kw, sym};
 use crate::ThinVec;
 use crate::util::parser::AssocOp;
 use errors::{Applicability, DiagnosticBuilder, DiagnosticId};
@@ -263,7 +263,7 @@ fn tokens_to_string(tokens: &[TokenType]) -> String {
         };
         self.last_unexpected_token_span = Some(self.span);
         let mut err = self.fatal(&msg_exp);
-        if self.token.is_ident_named("and") {
+        if self.token.is_ident_named(sym::and) {
             err.span_suggestion_short(
                 self.span,
                 "use `&&` instead of `and` for the boolean operator",
@@ -271,7 +271,7 @@ fn tokens_to_string(tokens: &[TokenType]) -> String {
                 Applicability::MaybeIncorrect,
             );
         }
-        if self.token.is_ident_named("or") {
+        if self.token.is_ident_named(sym::or) {
             err.span_suggestion_short(
                 self.span,
                 "use `||` instead of `or` for the boolean operator",