1
Fork 0

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`).
This commit is contained in:
Nicholas Nethercote 2024-12-20 14:04:25 +11:00
parent 2a1e2e9632
commit 53167c0b7f
20 changed files with 48 additions and 48 deletions

View file

@ -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));