@@ -1530,9 +1530,7 @@ impl<'a> Parser<'a> {
1530
1530
( ident, TraitItemKind :: Const ( ty, default) , ast:: Generics :: default ( ) )
1531
1531
} else if let Some ( mac) = self . parse_assoc_macro_invoc ( "trait" , None , & mut false ) ? {
1532
1532
// trait item macro.
1533
- ( Ident :: with_empty_ctxt ( kw:: Invalid ) ,
1534
- ast:: TraitItemKind :: Macro ( mac) ,
1535
- ast:: Generics :: default ( ) )
1533
+ ( Ident :: invalid ( ) , ast:: TraitItemKind :: Macro ( mac) , ast:: Generics :: default ( ) )
1536
1534
} else {
1537
1535
let ( constness, unsafety, mut asyncness, abi) = self . parse_fn_front_matter ( ) ?;
1538
1536
@@ -5169,7 +5167,7 @@ impl<'a> Parser<'a> {
5169
5167
5170
5168
// it's a macro invocation
5171
5169
let id = match self . token {
5172
- token:: OpenDelim ( _) => Ident :: with_empty_ctxt ( kw :: Invalid ) , // no special identifier
5170
+ token:: OpenDelim ( _) => Ident :: invalid ( ) , // no special identifier
5173
5171
_ => self . parse_ident ( ) ?,
5174
5172
} ;
5175
5173
@@ -6577,7 +6575,7 @@ impl<'a> Parser<'a> {
6577
6575
// code copied from parse_macro_use_or_failure... abstraction!
6578
6576
if let Some ( mac) = self . parse_assoc_macro_invoc ( "impl" , Some ( vis) , at_end) ? {
6579
6577
// method macro
6580
- Ok ( ( Ident :: with_empty_ctxt ( kw :: Invalid ) , vec ! [ ] , ast:: Generics :: default ( ) ,
6578
+ Ok ( ( Ident :: invalid ( ) , vec ! [ ] , ast:: Generics :: default ( ) ,
6581
6579
ast:: ImplItemKind :: Macro ( mac) ) )
6582
6580
} else {
6583
6581
let ( constness, unsafety, mut asyncness, abi) = self . parse_fn_front_matter ( ) ?;
@@ -6797,7 +6795,7 @@ impl<'a> Parser<'a> {
6797
6795
}
6798
6796
} ;
6799
6797
6800
- Ok ( ( Ident :: with_empty_ctxt ( kw :: Invalid ) , item_kind, Some ( attrs) ) )
6798
+ Ok ( ( Ident :: invalid ( ) , item_kind, Some ( attrs) ) )
6801
6799
}
6802
6800
6803
6801
fn parse_late_bound_lifetime_defs ( & mut self ) -> PResult < ' a , Vec < GenericParam > > {
@@ -7614,7 +7612,7 @@ impl<'a> Parser<'a> {
7614
7612
abi,
7615
7613
items : foreign_items
7616
7614
} ;
7617
- let invalid = Ident :: with_empty_ctxt ( kw :: Invalid ) ;
7615
+ let invalid = Ident :: invalid ( ) ;
7618
7616
Ok ( self . mk_item ( lo. to ( prev_span) , invalid, ItemKind :: ForeignMod ( m) , visibility, attrs) )
7619
7617
}
7620
7618
@@ -7862,7 +7860,7 @@ impl<'a> Parser<'a> {
7862
7860
7863
7861
let span = lo. to ( self . prev_span ) ;
7864
7862
let item =
7865
- self . mk_item ( span, Ident :: with_empty_ctxt ( kw :: Invalid ) , item_, visibility, attrs) ;
7863
+ self . mk_item ( span, Ident :: invalid ( ) , item_, visibility, attrs) ;
7866
7864
return Ok ( Some ( item) ) ;
7867
7865
}
7868
7866
@@ -8308,7 +8306,7 @@ impl<'a> Parser<'a> {
8308
8306
Some ( mac) => {
8309
8307
Ok (
8310
8308
ForeignItem {
8311
- ident : Ident :: with_empty_ctxt ( kw :: Invalid ) ,
8309
+ ident : Ident :: invalid ( ) ,
8312
8310
span : lo. to ( self . prev_span ) ,
8313
8311
id : ast:: DUMMY_NODE_ID ,
8314
8312
attrs,
@@ -8355,7 +8353,7 @@ impl<'a> Parser<'a> {
8355
8353
let id = if self . token . is_ident ( ) {
8356
8354
self . parse_ident ( ) ?
8357
8355
} else {
8358
- Ident :: with_empty_ctxt ( kw :: Invalid ) // no special identifier
8356
+ Ident :: invalid ( ) // no special identifier
8359
8357
} ;
8360
8358
// eat a matched-delimiter token tree:
8361
8359
let ( delim, tts) = self . expect_delimited_token_tree ( ) ?;
0 commit comments