From 52992979c5a336335408be9f21d24037f6017e98 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 20 Aug 2020 13:51:39 +0000 Subject: [PATCH] Rename rustc_lexer::TokenKind::Not to Bang All other tokens are named by the punctuation they use, rather than by semantics operation they stand for. `!` is the only exception to the rule, let's fix it. --- src/librustc_lexer/src/lib.rs | 4 ++-- src/librustc_parse/lexer/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_lexer/src/lib.rs b/src/librustc_lexer/src/lib.rs index 7949a232b9b35..f94466b03ed1e 100644 --- a/src/librustc_lexer/src/lib.rs +++ b/src/librustc_lexer/src/lib.rs @@ -103,7 +103,7 @@ pub enum TokenKind { /// "=" Eq, /// "!" - Not, + Bang, /// "<" Lt, /// ">" @@ -378,7 +378,7 @@ impl Cursor<'_> { ':' => Colon, '$' => Dollar, '=' => Eq, - '!' => Not, + '!' => Bang, '<' => Lt, '>' => Gt, '-' => Minus, diff --git a/src/librustc_parse/lexer/mod.rs b/src/librustc_parse/lexer/mod.rs index 675cfa41f1048..398e23a6ff727 100644 --- a/src/librustc_parse/lexer/mod.rs +++ b/src/librustc_parse/lexer/mod.rs @@ -290,7 +290,7 @@ impl<'a> StringReader<'a> { rustc_lexer::TokenKind::Colon => token::Colon, rustc_lexer::TokenKind::Dollar => token::Dollar, rustc_lexer::TokenKind::Eq => token::Eq, - rustc_lexer::TokenKind::Not => token::Not, + rustc_lexer::TokenKind::Bang => token::Not, rustc_lexer::TokenKind::Lt => token::Lt, rustc_lexer::TokenKind::Gt => token::Gt, rustc_lexer::TokenKind::Minus => token::BinOp(token::Minus),