Skip to content

Commit 2a3f43d

Browse files
authored
Rollup merge of #75743 - matklad:excl, r=davidtwco
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.
2 parents 6ac1523 + 5299297 commit 2a3f43d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_lexer/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub enum TokenKind {
103103
/// "="
104104
Eq,
105105
/// "!"
106-
Not,
106+
Bang,
107107
/// "<"
108108
Lt,
109109
/// ">"
@@ -378,7 +378,7 @@ impl Cursor<'_> {
378378
':' => Colon,
379379
'$' => Dollar,
380380
'=' => Eq,
381-
'!' => Not,
381+
'!' => Bang,
382382
'<' => Lt,
383383
'>' => Gt,
384384
'-' => Minus,

src/librustc_parse/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'a> StringReader<'a> {
290290
rustc_lexer::TokenKind::Colon => token::Colon,
291291
rustc_lexer::TokenKind::Dollar => token::Dollar,
292292
rustc_lexer::TokenKind::Eq => token::Eq,
293-
rustc_lexer::TokenKind::Not => token::Not,
293+
rustc_lexer::TokenKind::Bang => token::Not,
294294
rustc_lexer::TokenKind::Lt => token::Lt,
295295
rustc_lexer::TokenKind::Gt => token::Gt,
296296
rustc_lexer::TokenKind::Minus => token::BinOp(token::Minus),

0 commit comments

Comments
 (0)