@@ -306,7 +306,7 @@ pub struct Invocation {
306
306
307
307
pub enum InvocationKind {
308
308
Bang {
309
- mac : ast:: MacCall ,
309
+ mac : P < ast:: MacCall > ,
310
310
span : Span ,
311
311
} ,
312
312
Attr {
@@ -1017,7 +1017,7 @@ trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized {
1017
1017
fn is_mac_call ( & self ) -> bool {
1018
1018
false
1019
1019
}
1020
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1020
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1021
1021
unreachable ! ( )
1022
1022
}
1023
1023
fn pre_flat_map_node_collect_attr ( _cfg : & StripUnconfigured < ' _ > , _attr : & ast:: Attribute ) { }
@@ -1046,7 +1046,7 @@ impl InvocationCollectorNode for P<ast::Item> {
1046
1046
fn is_mac_call ( & self ) -> bool {
1047
1047
matches ! ( self . kind, ItemKind :: MacCall ( ..) )
1048
1048
}
1049
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1049
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1050
1050
let node = self . into_inner ( ) ;
1051
1051
match node. kind {
1052
1052
ItemKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
@@ -1154,7 +1154,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitItemTag>
1154
1154
fn is_mac_call ( & self ) -> bool {
1155
1155
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
1156
1156
}
1157
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1157
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1158
1158
let item = self . wrapped . into_inner ( ) ;
1159
1159
match item. kind {
1160
1160
AssocItemKind :: MacCall ( mac) => ( mac, item. attrs , AddSemicolon :: No ) ,
@@ -1179,7 +1179,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, ImplItemTag>
1179
1179
fn is_mac_call ( & self ) -> bool {
1180
1180
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
1181
1181
}
1182
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1182
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1183
1183
let item = self . wrapped . into_inner ( ) ;
1184
1184
match item. kind {
1185
1185
AssocItemKind :: MacCall ( mac) => ( mac, item. attrs , AddSemicolon :: No ) ,
@@ -1202,7 +1202,7 @@ impl InvocationCollectorNode for P<ast::ForeignItem> {
1202
1202
fn is_mac_call ( & self ) -> bool {
1203
1203
matches ! ( self . kind, ForeignItemKind :: MacCall ( ..) )
1204
1204
}
1205
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1205
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1206
1206
let node = self . into_inner ( ) ;
1207
1207
match node. kind {
1208
1208
ForeignItemKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
@@ -1323,7 +1323,7 @@ impl InvocationCollectorNode for ast::Stmt {
1323
1323
StmtKind :: Local ( ..) | StmtKind :: Empty => false ,
1324
1324
}
1325
1325
}
1326
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1326
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1327
1327
// We pull macro invocations (both attributes and fn-like macro calls) out of their
1328
1328
// `StmtKind`s and treat them as statement macro invocations, not as items or expressions.
1329
1329
let ( add_semicolon, mac, attrs) = match self . kind {
@@ -1387,7 +1387,7 @@ impl InvocationCollectorNode for P<ast::Ty> {
1387
1387
fn is_mac_call ( & self ) -> bool {
1388
1388
matches ! ( self . kind, ast:: TyKind :: MacCall ( ..) )
1389
1389
}
1390
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1390
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1391
1391
let node = self . into_inner ( ) ;
1392
1392
match node. kind {
1393
1393
TyKind :: MacCall ( mac) => ( mac, Vec :: new ( ) , AddSemicolon :: No ) ,
@@ -1411,7 +1411,7 @@ impl InvocationCollectorNode for P<ast::Pat> {
1411
1411
fn is_mac_call ( & self ) -> bool {
1412
1412
matches ! ( self . kind, PatKind :: MacCall ( ..) )
1413
1413
}
1414
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1414
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1415
1415
let node = self . into_inner ( ) ;
1416
1416
match node. kind {
1417
1417
PatKind :: MacCall ( mac) => ( mac, Vec :: new ( ) , AddSemicolon :: No ) ,
@@ -1439,7 +1439,7 @@ impl InvocationCollectorNode for P<ast::Expr> {
1439
1439
fn is_mac_call ( & self ) -> bool {
1440
1440
matches ! ( self . kind, ExprKind :: MacCall ( ..) )
1441
1441
}
1442
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1442
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1443
1443
let node = self . into_inner ( ) ;
1444
1444
match node. kind {
1445
1445
ExprKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
@@ -1466,7 +1466,7 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, OptExprTag> {
1466
1466
fn is_mac_call ( & self ) -> bool {
1467
1467
matches ! ( self . wrapped. kind, ast:: ExprKind :: MacCall ( ..) )
1468
1468
}
1469
- fn take_mac_call ( self ) -> ( ast:: MacCall , Self :: AttrsTy , AddSemicolon ) {
1469
+ fn take_mac_call ( self ) -> ( P < ast:: MacCall > , Self :: AttrsTy , AddSemicolon ) {
1470
1470
let node = self . wrapped . into_inner ( ) ;
1471
1471
match node. kind {
1472
1472
ExprKind :: MacCall ( mac) => ( mac, node. attrs , AddSemicolon :: No ) ,
@@ -1512,7 +1512,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
1512
1512
placeholder ( fragment_kind, NodeId :: placeholder_from_expn_id ( expn_id) , vis)
1513
1513
}
1514
1514
1515
- fn collect_bang ( & mut self , mac : ast:: MacCall , kind : AstFragmentKind ) -> AstFragment {
1515
+ fn collect_bang ( & mut self , mac : P < ast:: MacCall > , kind : AstFragmentKind ) -> AstFragment {
1516
1516
// cache the macro call span so that it can be
1517
1517
// easily adjusted for incremental compilation
1518
1518
let span = mac. span ( ) ;
0 commit comments