@@ -382,7 +382,7 @@ impl<'a> Parser<'a> {
382
382
383
383
/// Are we sure this could not possibly be a macro invocation?
384
384
fn isnt_macro_invocation ( & mut self ) -> bool {
385
- self . check_ident ( ) && self . look_ahead ( 1 , |t| * t != token:: Not && * t != token:: PathSep )
385
+ self . check_ident ( ) && self . look_ahead ( 1 , |t| * t != token:: Bang && * t != token:: PathSep )
386
386
}
387
387
388
388
/// Recover on encountering a struct, enum, or method definition where the user
@@ -480,7 +480,7 @@ impl<'a> Parser<'a> {
480
480
/// Parses an item macro, e.g., `item!();`.
481
481
fn parse_item_macro ( & mut self , vis : & Visibility ) -> PResult < ' a , MacCall > {
482
482
let path = self . parse_path ( PathStyle :: Mod ) ?; // `foo::bar`
483
- self . expect ( exp ! ( Not ) ) ?; // `!`
483
+ self . expect ( exp ! ( Bang ) ) ?; // `!`
484
484
match self . parse_delim_args ( ) {
485
485
// `( .. )` or `[ .. ]` (followed by `;`), or `{ .. }`.
486
486
Ok ( args) => {
@@ -540,7 +540,7 @@ impl<'a> Parser<'a> {
540
540
541
541
fn parse_polarity ( & mut self ) -> ast:: ImplPolarity {
542
542
// Disambiguate `impl !Trait for Type { ... }` and `impl ! { ... }` for the never type.
543
- if self . check ( exp ! ( Not ) ) && self . look_ahead ( 1 , |t| t. can_begin_type ( ) ) {
543
+ if self . check ( exp ! ( Bang ) ) && self . look_ahead ( 1 , |t| t. can_begin_type ( ) ) {
544
544
self . bump ( ) ; // `!`
545
545
ast:: ImplPolarity :: Negative ( self . prev_token . span )
546
546
} else {
@@ -1579,7 +1579,7 @@ impl<'a> Parser<'a> {
1579
1579
}
1580
1580
let ident = this. parse_field_ident ( "enum" , vlo) ?;
1581
1581
1582
- if this. token == token:: Not {
1582
+ if this. token == token:: Bang {
1583
1583
if let Err ( err) = this. unexpected ( ) {
1584
1584
err. with_note ( fluent:: parse_macro_expands_to_enum_variant) . emit ( ) ;
1585
1585
}
@@ -2034,7 +2034,7 @@ impl<'a> Parser<'a> {
2034
2034
attrs : AttrVec ,
2035
2035
) -> PResult < ' a , FieldDef > {
2036
2036
let name = self . parse_field_ident ( adt_ty, lo) ?;
2037
- if self . token == token:: Not {
2037
+ if self . token == token:: Bang {
2038
2038
if let Err ( mut err) = self . unexpected ( ) {
2039
2039
// Encounter the macro invocation
2040
2040
err. subdiagnostic ( MacroExpandsToAdtField { adt_ty } ) ;
@@ -2184,7 +2184,7 @@ impl<'a> Parser<'a> {
2184
2184
if self . check_keyword ( exp ! ( MacroRules ) ) {
2185
2185
let macro_rules_span = self . token . span ;
2186
2186
2187
- if self . look_ahead ( 1 , |t| * t == token:: Not ) && self . look_ahead ( 2 , |t| t. is_ident ( ) ) {
2187
+ if self . look_ahead ( 1 , |t| * t == token:: Bang ) && self . look_ahead ( 2 , |t| t. is_ident ( ) ) {
2188
2188
return IsMacroRulesItem :: Yes { has_bang : true } ;
2189
2189
} else if self . look_ahead ( 1 , |t| ( t. is_ident ( ) ) ) {
2190
2190
// macro_rules foo
@@ -2209,11 +2209,11 @@ impl<'a> Parser<'a> {
2209
2209
self . expect_keyword ( exp ! ( MacroRules ) ) ?; // `macro_rules`
2210
2210
2211
2211
if has_bang {
2212
- self . expect ( exp ! ( Not ) ) ?; // `!`
2212
+ self . expect ( exp ! ( Bang ) ) ?; // `!`
2213
2213
}
2214
2214
let ident = self . parse_ident ( ) ?;
2215
2215
2216
- if self . eat ( exp ! ( Not ) ) {
2216
+ if self . eat ( exp ! ( Bang ) ) {
2217
2217
// Handle macro_rules! foo!
2218
2218
let span = self . prev_token . span ;
2219
2219
self . dcx ( ) . emit_err ( errors:: MacroNameRemoveBang { span } ) ;
0 commit comments