diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-20 14:04:25 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-03-03 09:26:13 +1100 |
| commit | 53167c0b7f8112a492b9442058a034605a120c9e (patch) | |
| tree | 15877b1e7c7a474f59cd9040cf961483435e1fad /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 2a1e2e9632af4098aea3136fc80e165284deb927 (diff) | |
| download | rust-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_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index a991ad14bc8..23b366dc2c9 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -505,7 +505,7 @@ impl<'a> Parser<'a> { // Note: when adding new unary operators, don't forget to adjust TokenKind::can_begin_expr() match this.token.uninterpolate().kind { // `!expr` - token::Not => make_it!(this, attrs, |this, _| this.parse_expr_unary(lo, UnOp::Not)), + token::Bang => make_it!(this, attrs, |this, _| this.parse_expr_unary(lo, UnOp::Not)), // `~expr` token::Tilde => make_it!(this, attrs, |this, _| this.recover_tilde_expr(lo)), // `-expr` @@ -1570,7 +1570,7 @@ impl<'a> Parser<'a> { }; // `!`, as an operator, is prefix, so we know this isn't that. - let (span, kind) = if self.eat(exp!(Not)) { + let (span, kind) = if self.eat(exp!(Bang)) { // MACRO INVOCATION expression if qself.is_some() { self.dcx().emit_err(errors::MacroInvocationWithQualifiedPath(path.span)); |
