@@ -86,7 +86,7 @@ macro_rules! ast_fragments {
86
86
}
87
87
}
88
88
89
- fn make_from< ' a> ( self , result: Box <dyn MacResult + ' a >) -> Option <AstFragment > {
89
+ fn make_from( self , result: Box <dyn MacResult + ' _ >) -> Option <AstFragment > {
90
90
match self {
91
91
AstFragmentKind :: OptExpr =>
92
92
result. make_expr( ) . map( Some ) . map( AstFragment :: OptExpr ) ,
@@ -136,7 +136,7 @@ macro_rules! ast_fragments {
136
136
T :: fragment_to_output( self )
137
137
}
138
138
139
- pub ( crate ) fn mut_visit_with< F : MutVisitor > ( & mut self , vis: & mut F ) {
139
+ pub ( crate ) fn mut_visit_with( & mut self , vis: & mut impl MutVisitor ) {
140
140
match self {
141
141
AstFragment :: OptExpr ( opt_expr) => {
142
142
if let Some ( expr) = opt_expr. take( ) {
@@ -316,9 +316,9 @@ impl AstFragmentKind {
316
316
}
317
317
}
318
318
319
- pub ( crate ) fn expect_from_annotatables < I : IntoIterator < Item = Annotatable > > (
319
+ pub ( crate ) fn expect_from_annotatables (
320
320
self ,
321
- items : I ,
321
+ items : impl IntoIterator < Item = Annotatable > ,
322
322
) -> AstFragment {
323
323
let mut items = items. into_iter ( ) ;
324
324
match self {
@@ -1218,10 +1218,10 @@ trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized {
1218
1218
fn descr ( ) -> & ' static str {
1219
1219
unreachable ! ( )
1220
1220
}
1221
- fn walk_flat_map < V : MutVisitor > ( self , _visitor : & mut V ) -> Self :: OutputTy {
1221
+ fn walk_flat_map ( self , _collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1222
1222
unreachable ! ( )
1223
1223
}
1224
- fn walk < V : MutVisitor > ( & mut self , _visitor : & mut V ) {
1224
+ fn walk ( & mut self , _collector : & mut InvocationCollector < ' _ , ' _ > ) {
1225
1225
unreachable ! ( )
1226
1226
}
1227
1227
fn is_mac_call ( & self ) -> bool {
@@ -1276,8 +1276,8 @@ impl InvocationCollectorNode for P<ast::Item> {
1276
1276
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1277
1277
fragment. make_items ( )
1278
1278
}
1279
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1280
- walk_flat_map_item ( visitor , self )
1279
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1280
+ walk_flat_map_item ( collector , self )
1281
1281
}
1282
1282
fn is_mac_call ( & self ) -> bool {
1283
1283
matches ! ( self . kind, ItemKind :: MacCall ( ..) )
@@ -1431,8 +1431,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitItemTag>
1431
1431
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1432
1432
fragment. make_trait_items ( )
1433
1433
}
1434
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1435
- walk_flat_map_assoc_item ( visitor , self . wrapped , AssocCtxt :: Trait )
1434
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1435
+ walk_flat_map_assoc_item ( collector , self . wrapped , AssocCtxt :: Trait )
1436
1436
}
1437
1437
fn is_mac_call ( & self ) -> bool {
1438
1438
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
@@ -1472,8 +1472,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, ImplItemTag>
1472
1472
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1473
1473
fragment. make_impl_items ( )
1474
1474
}
1475
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1476
- walk_flat_map_assoc_item ( visitor , self . wrapped , AssocCtxt :: Impl { of_trait : false } )
1475
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1476
+ walk_flat_map_assoc_item ( collector , self . wrapped , AssocCtxt :: Impl { of_trait : false } )
1477
1477
}
1478
1478
fn is_mac_call ( & self ) -> bool {
1479
1479
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
@@ -1513,8 +1513,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::AssocItem>, TraitImplItem
1513
1513
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1514
1514
fragment. make_trait_impl_items ( )
1515
1515
}
1516
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1517
- walk_flat_map_assoc_item ( visitor , self . wrapped , AssocCtxt :: Impl { of_trait : true } )
1516
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1517
+ walk_flat_map_assoc_item ( collector , self . wrapped , AssocCtxt :: Impl { of_trait : true } )
1518
1518
}
1519
1519
fn is_mac_call ( & self ) -> bool {
1520
1520
matches ! ( self . wrapped. kind, AssocItemKind :: MacCall ( ..) )
@@ -1551,8 +1551,8 @@ impl InvocationCollectorNode for P<ast::ForeignItem> {
1551
1551
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1552
1552
fragment. make_foreign_items ( )
1553
1553
}
1554
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1555
- walk_flat_map_foreign_item ( visitor , self )
1554
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1555
+ walk_flat_map_foreign_item ( collector , self )
1556
1556
}
1557
1557
fn is_mac_call ( & self ) -> bool {
1558
1558
matches ! ( self . kind, ForeignItemKind :: MacCall ( ..) )
@@ -1573,8 +1573,8 @@ impl InvocationCollectorNode for ast::Variant {
1573
1573
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1574
1574
fragment. make_variants ( )
1575
1575
}
1576
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1577
- walk_flat_map_variant ( visitor , self )
1576
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1577
+ walk_flat_map_variant ( collector , self )
1578
1578
}
1579
1579
}
1580
1580
@@ -1586,8 +1586,8 @@ impl InvocationCollectorNode for ast::WherePredicate {
1586
1586
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1587
1587
fragment. make_where_predicates ( )
1588
1588
}
1589
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1590
- walk_flat_map_where_predicate ( visitor , self )
1589
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1590
+ walk_flat_map_where_predicate ( collector , self )
1591
1591
}
1592
1592
}
1593
1593
@@ -1599,8 +1599,8 @@ impl InvocationCollectorNode for ast::FieldDef {
1599
1599
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1600
1600
fragment. make_field_defs ( )
1601
1601
}
1602
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1603
- walk_flat_map_field_def ( visitor , self )
1602
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1603
+ walk_flat_map_field_def ( collector , self )
1604
1604
}
1605
1605
}
1606
1606
@@ -1612,8 +1612,8 @@ impl InvocationCollectorNode for ast::PatField {
1612
1612
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1613
1613
fragment. make_pat_fields ( )
1614
1614
}
1615
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1616
- walk_flat_map_pat_field ( visitor , self )
1615
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1616
+ walk_flat_map_pat_field ( collector , self )
1617
1617
}
1618
1618
}
1619
1619
@@ -1625,8 +1625,8 @@ impl InvocationCollectorNode for ast::ExprField {
1625
1625
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1626
1626
fragment. make_expr_fields ( )
1627
1627
}
1628
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1629
- walk_flat_map_expr_field ( visitor , self )
1628
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1629
+ walk_flat_map_expr_field ( collector , self )
1630
1630
}
1631
1631
}
1632
1632
@@ -1638,8 +1638,8 @@ impl InvocationCollectorNode for ast::Param {
1638
1638
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1639
1639
fragment. make_params ( )
1640
1640
}
1641
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1642
- walk_flat_map_param ( visitor , self )
1641
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1642
+ walk_flat_map_param ( collector , self )
1643
1643
}
1644
1644
}
1645
1645
@@ -1651,8 +1651,8 @@ impl InvocationCollectorNode for ast::GenericParam {
1651
1651
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1652
1652
fragment. make_generic_params ( )
1653
1653
}
1654
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1655
- walk_flat_map_generic_param ( visitor , self )
1654
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1655
+ walk_flat_map_generic_param ( collector , self )
1656
1656
}
1657
1657
}
1658
1658
@@ -1664,8 +1664,8 @@ impl InvocationCollectorNode for ast::Arm {
1664
1664
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1665
1665
fragment. make_arms ( )
1666
1666
}
1667
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1668
- walk_flat_map_arm ( visitor , self )
1667
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1668
+ walk_flat_map_arm ( collector , self )
1669
1669
}
1670
1670
}
1671
1671
@@ -1677,8 +1677,8 @@ impl InvocationCollectorNode for ast::Stmt {
1677
1677
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1678
1678
fragment. make_stmts ( )
1679
1679
}
1680
- fn walk_flat_map < V : MutVisitor > ( self , visitor : & mut V ) -> Self :: OutputTy {
1681
- walk_flat_map_stmt ( visitor , self )
1680
+ fn walk_flat_map ( self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1681
+ walk_flat_map_stmt ( collector , self )
1682
1682
}
1683
1683
fn is_mac_call ( & self ) -> bool {
1684
1684
match & self . kind {
@@ -1751,8 +1751,8 @@ impl InvocationCollectorNode for ast::Crate {
1751
1751
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1752
1752
fragment. make_crate ( )
1753
1753
}
1754
- fn walk < V : MutVisitor > ( & mut self , visitor : & mut V ) {
1755
- walk_crate ( visitor , self )
1754
+ fn walk ( & mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) {
1755
+ walk_crate ( collector , self )
1756
1756
}
1757
1757
fn expand_cfg_false (
1758
1758
& mut self ,
@@ -1777,8 +1777,8 @@ impl InvocationCollectorNode for ast::Ty {
1777
1777
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1778
1778
fragment. make_ty ( )
1779
1779
}
1780
- fn walk < V : MutVisitor > ( & mut self , visitor : & mut V ) {
1781
- walk_ty ( visitor , self )
1780
+ fn walk ( & mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) {
1781
+ walk_ty ( collector , self )
1782
1782
}
1783
1783
fn is_mac_call ( & self ) -> bool {
1784
1784
matches ! ( self . kind, ast:: TyKind :: MacCall ( ..) )
@@ -1800,8 +1800,8 @@ impl InvocationCollectorNode for ast::Pat {
1800
1800
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1801
1801
fragment. make_pat ( )
1802
1802
}
1803
- fn walk < V : MutVisitor > ( & mut self , visitor : & mut V ) {
1804
- walk_pat ( visitor , self )
1803
+ fn walk ( & mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) {
1804
+ walk_pat ( collector , self )
1805
1805
}
1806
1806
fn is_mac_call ( & self ) -> bool {
1807
1807
matches ! ( self . kind, PatKind :: MacCall ( ..) )
@@ -1826,8 +1826,8 @@ impl InvocationCollectorNode for ast::Expr {
1826
1826
fn descr ( ) -> & ' static str {
1827
1827
"an expression"
1828
1828
}
1829
- fn walk < V : MutVisitor > ( & mut self , visitor : & mut V ) {
1830
- walk_expr ( visitor , self )
1829
+ fn walk ( & mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) {
1830
+ walk_expr ( collector , self )
1831
1831
}
1832
1832
fn is_mac_call ( & self ) -> bool {
1833
1833
matches ! ( self . kind, ExprKind :: MacCall ( ..) )
@@ -1850,8 +1850,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, OptExprTag> {
1850
1850
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1851
1851
fragment. make_opt_expr ( )
1852
1852
}
1853
- fn walk_flat_map < V : MutVisitor > ( mut self , visitor : & mut V ) -> Self :: OutputTy {
1854
- walk_expr ( visitor , & mut self . wrapped ) ;
1853
+ fn walk_flat_map ( mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) -> Self :: OutputTy {
1854
+ walk_expr ( collector , & mut self . wrapped ) ;
1855
1855
Some ( self . wrapped )
1856
1856
}
1857
1857
fn is_mac_call ( & self ) -> bool {
@@ -1885,8 +1885,8 @@ impl InvocationCollectorNode for AstNodeWrapper<P<ast::Expr>, MethodReceiverTag>
1885
1885
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1886
1886
AstNodeWrapper :: new ( fragment. make_method_receiver_expr ( ) , MethodReceiverTag )
1887
1887
}
1888
- fn walk < V : MutVisitor > ( & mut self , visitor : & mut V ) {
1889
- walk_expr ( visitor , & mut self . wrapped )
1888
+ fn walk ( & mut self , collector : & mut InvocationCollector < ' _ , ' _ > ) {
1889
+ walk_expr ( collector , & mut self . wrapped )
1890
1890
}
1891
1891
fn is_mac_call ( & self ) -> bool {
1892
1892
matches ! ( self . wrapped. kind, ast:: ExprKind :: MacCall ( ..) )
0 commit comments