about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/token.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-12-20 14:04:25 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-03-03 09:26:13 +1100
commit53167c0b7f8112a492b9442058a034605a120c9e (patch)
tree15877b1e7c7a474f59cd9040cf961483435e1fad /compiler/rustc_ast/src/token.rs
parent2a1e2e9632af4098aea3136fc80e165284deb927 (diff)
downloadrust-53167c0b7f8112a492b9442058a034605a120c9e.tar.gz
rust-53167c0b7f8112a492b9442058a034605a120c9e.zip
Rename `ast::TokenKind::Not` as `ast::TokenKind::Bang`.
For consistency with `rustc_lexer::TokenKind::Bang`, and because other
`ast::TokenKind` variants generally have syntactic names instead of
semantic names (e.g. `Star` and `DotDot` instead of `Mul` and `Range`).
Diffstat (limited to 'compiler/rustc_ast/src/token.rs')
-rw-r--r--compiler/rustc_ast/src/token.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs
index 9304636eda6..ff1edad725a 100644
--- a/compiler/rustc_ast/src/token.rs
+++ b/compiler/rustc_ast/src/token.rs
@@ -360,7 +360,7 @@ pub enum TokenKind {
     /// `||`
     OrOr,
     /// `!`
-    Not,
+    Bang,
     /// `~`
     Tilde,
     // `+`
@@ -522,7 +522,7 @@ impl TokenKind {
         Some(match (self, n) {
             (Le, 1) => (Lt, Eq),
             (EqEq, 1) => (Eq, Eq),
-            (Ne, 1) => (Not, Eq),
+            (Ne, 1) => (Bang, Eq),
             (Ge, 1) => (Gt, Eq),
             (AndAnd, 1) => (And, And),
             (OrOr, 1) => (Or, Or),
@@ -604,7 +604,7 @@ impl Token {
 
     pub fn is_punct(&self) -> bool {
         match self.kind {
-            Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Not | Tilde | Plus | Minus
+            Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Bang | Tilde | Plus | Minus
             | Star | Slash | Percent | Caret | And | Or | Shl | Shr | PlusEq | MinusEq | StarEq
             | SlashEq | PercentEq | CaretEq | AndEq | OrEq | ShlEq | ShrEq | At | Dot | DotDot
             | DotDotDot | DotDotEq | Comma | Semi | Colon | PathSep | RArrow | LArrow
@@ -630,7 +630,7 @@ impl Token {
                 ident_can_begin_expr(name, self.span, is_raw), // value name or keyword
             OpenDelim(Parenthesis | Brace | Bracket) | // tuple, array or block
             Literal(..)                       | // literal
-            Not                               | // operator not
+            Bang                              | // operator not
             Minus                             | // unary minus
             Star                              | // dereference
             Or | OrOr                         | // closure
@@ -701,7 +701,7 @@ impl Token {
                 ident_can_begin_type(name, self.span, is_raw), // type name or keyword
             OpenDelim(Delimiter::Parenthesis) | // tuple
             OpenDelim(Delimiter::Bracket)     | // array
-            Not                               | // never
+            Bang                              | // never
             Star                              | // raw pointer
             And                               | // reference
             AndAnd                            | // double reference
@@ -1004,8 +1004,8 @@ impl Token {
             (Gt, Ge) => ShrEq,
             (Gt, _) => return None,
 
-            (Not, Eq) => Ne,
-            (Not, _) => return None,
+            (Bang, Eq) => Ne,
+            (Bang, _) => return None,
 
             (Plus, Eq) => PlusEq,
             (Plus, _) => return None,