diff options
| author | bors <bors@rust-lang.org> | 2019-05-27 06:53:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-27 06:53:53 +0000 |
| commit | ab7cf71d4c6dd1696cb0eb52ad172bce296578cc (patch) | |
| tree | 48c001b66e3a12c491ca5e20b8fb63d303c08636 /src/libsyntax/parse/parser.rs | |
| parent | be10e6277b738df3cc8ac316872227879118cc64 (diff) | |
| parent | 33a3206dc5e7f267617a625d8b31ccc3250cdc1e (diff) | |
| download | rust-ab7cf71d4c6dd1696cb0eb52ad172bce296578cc.tar.gz rust-ab7cf71d4c6dd1696cb0eb52ad172bce296578cc.zip | |
Auto merge of #61035 - nnethercote:avoid-more-symbol-interning, r=petrochenkov
Avoid more symbol interning r? @petrochenkov
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6c29437362c..07efeaa4cf2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2759,7 +2759,7 @@ impl<'a> Parser<'a> { let (span, e) = self.interpolated_or_expr_span(e)?; (lo.to(span), ExprKind::Box(e)) } - token::Ident(..) if self.token.is_ident_named("not") => { + token::Ident(..) if self.token.is_ident_named(sym::not) => { // `not` is just an ordinary identifier in Rust-the-language, // but as `rustc`-the-compiler, we can issue clever diagnostics // for confused users who really want to say `!` @@ -4592,7 +4592,7 @@ impl<'a> Parser<'a> { let do_not_suggest_help = self.token.is_keyword(kw::In) || self.token == token::Colon; - if self.token.is_ident_named("and") { + if self.token.is_ident_named(sym::and) { e.span_suggestion_short( self.span, "use `&&` instead of `and` for the boolean operator", @@ -4600,7 +4600,7 @@ impl<'a> Parser<'a> { Applicability::MaybeIncorrect, ); } - if self.token.is_ident_named("or") { + if self.token.is_ident_named(sym::or) { e.span_suggestion_short( self.span, "use `||` instead of `or` for the boolean operator", @@ -5787,7 +5787,7 @@ impl<'a> Parser<'a> { VisibilityKind::Inherited => {} _ => { let is_macro_rules: bool = match self.token { - token::Ident(sid, _) => sid.name == Symbol::intern("macro_rules"), + token::Ident(sid, _) => sid.name == sym::macro_rules, _ => false, }; let mut err = if is_macro_rules { |
