@@ -1668,7 +1668,7 @@ impl InvocationCollectorNode for ast::Crate {
1668
1668
}
1669
1669
}
1670
1670
1671
- impl InvocationCollectorNode for P < ast:: Ty > {
1671
+ impl InvocationCollectorNode for ast:: Ty {
1672
1672
type OutputTy = P < ast:: Ty > ;
1673
1673
const KIND : AstFragmentKind = AstFragmentKind :: Ty ;
1674
1674
fn to_annotatable ( self ) -> Annotatable {
@@ -1691,7 +1691,7 @@ impl InvocationCollectorNode for P<ast::Ty> {
1691
1691
}
1692
1692
}
1693
1693
1694
- impl InvocationCollectorNode for P < ast:: Pat > {
1694
+ impl InvocationCollectorNode for ast:: Pat {
1695
1695
type OutputTy = P < ast:: Pat > ;
1696
1696
const KIND : AstFragmentKind = AstFragmentKind :: Pat ;
1697
1697
fn to_annotatable ( self ) -> Annotatable {
@@ -1714,11 +1714,11 @@ impl InvocationCollectorNode for P<ast::Pat> {
1714
1714
}
1715
1715
}
1716
1716
1717
- impl InvocationCollectorNode for P < ast:: Expr > {
1717
+ impl InvocationCollectorNode for ast:: Expr {
1718
1718
type OutputTy = P < ast:: Expr > ;
1719
1719
const KIND : AstFragmentKind = AstFragmentKind :: Expr ;
1720
1720
fn to_annotatable ( self ) -> Annotatable {
1721
- Annotatable :: Expr ( self )
1721
+ Annotatable :: Expr ( P ( self ) )
1722
1722
}
1723
1723
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1724
1724
fragment. make_expr ( )
@@ -1855,37 +1855,37 @@ impl DummyAstNode for ast::Crate {
1855
1855
}
1856
1856
}
1857
1857
1858
- impl DummyAstNode for P < ast:: Ty > {
1858
+ impl DummyAstNode for ast:: Ty {
1859
1859
fn dummy ( ) -> Self {
1860
- P ( ast:: Ty {
1860
+ ast:: Ty {
1861
1861
id : DUMMY_NODE_ID ,
1862
1862
kind : TyKind :: Dummy ,
1863
1863
span : Default :: default ( ) ,
1864
1864
tokens : Default :: default ( ) ,
1865
- } )
1865
+ }
1866
1866
}
1867
1867
}
1868
1868
1869
- impl DummyAstNode for P < ast:: Pat > {
1869
+ impl DummyAstNode for ast:: Pat {
1870
1870
fn dummy ( ) -> Self {
1871
- P ( ast:: Pat {
1871
+ ast:: Pat {
1872
1872
id : DUMMY_NODE_ID ,
1873
1873
kind : PatKind :: Wild ,
1874
1874
span : Default :: default ( ) ,
1875
1875
tokens : Default :: default ( ) ,
1876
- } )
1876
+ }
1877
1877
}
1878
1878
}
1879
1879
1880
- impl DummyAstNode for P < ast:: Expr > {
1880
+ impl DummyAstNode for ast:: Expr {
1881
1881
fn dummy ( ) -> Self {
1882
1882
ast:: Expr :: dummy ( )
1883
1883
}
1884
1884
}
1885
1885
1886
1886
impl DummyAstNode for AstNodeWrapper < P < ast:: Expr > , MethodReceiverTag > {
1887
1887
fn dummy ( ) -> Self {
1888
- AstNodeWrapper :: new ( ast:: Expr :: dummy ( ) , MethodReceiverTag )
1888
+ AstNodeWrapper :: new ( P ( ast:: Expr :: dummy ( ) ) , MethodReceiverTag )
1889
1889
}
1890
1890
}
1891
1891
@@ -2172,7 +2172,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
2172
2172
}
2173
2173
}
2174
2174
2175
- fn visit_node < Node : InvocationCollectorNode < OutputTy = Node > + DummyAstNode > (
2175
+ fn visit_node < Node : InvocationCollectorNode < OutputTy : Into < Node > > + DummyAstNode > (
2176
2176
& mut self ,
2177
2177
node : & mut Node ,
2178
2178
) {
@@ -2196,15 +2196,15 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
2196
2196
let n = mem:: replace ( node, Node :: dummy ( ) ) ;
2197
2197
* node = self
2198
2198
. collect_attr ( ( attr, pos, derives) , n. to_annotatable ( ) , Node :: KIND )
2199
- . make_ast :: < Node > ( )
2199
+ . make_ast :: < Node > ( ) . into ( )
2200
2200
}
2201
2201
} ,
2202
2202
None if node. is_mac_call ( ) => {
2203
2203
let n = mem:: replace ( node, Node :: dummy ( ) ) ;
2204
2204
let ( mac, attrs, _) = n. take_mac_call ( ) ;
2205
2205
self . check_attributes ( & attrs, & mac) ;
2206
2206
2207
- * node = self . collect_bang ( mac, Node :: KIND ) . make_ast :: < Node > ( )
2207
+ * node = self . collect_bang ( mac, Node :: KIND ) . make_ast :: < Node > ( ) . into ( )
2208
2208
}
2209
2209
None if node. delegation ( ) . is_some ( ) => unreachable ! ( ) ,
2210
2210
None => {
@@ -2314,15 +2314,15 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
2314
2314
self . visit_node ( node)
2315
2315
}
2316
2316
2317
- fn visit_ty ( & mut self , node : & mut P < ast:: Ty > ) {
2317
+ fn visit_ty ( & mut self , node : & mut ast:: Ty ) {
2318
2318
self . visit_node ( node)
2319
2319
}
2320
2320
2321
- fn visit_pat ( & mut self , node : & mut P < ast:: Pat > ) {
2321
+ fn visit_pat ( & mut self , node : & mut ast:: Pat ) {
2322
2322
self . visit_node ( node)
2323
2323
}
2324
2324
2325
- fn visit_expr ( & mut self , node : & mut P < ast:: Expr > ) {
2325
+ fn visit_expr ( & mut self , node : & mut ast:: Expr ) {
2326
2326
// FIXME: Feature gating is performed inconsistently between `Expr` and `OptExpr`.
2327
2327
if let Some ( attr) = node. attrs . first ( ) {
2328
2328
self . cfg ( ) . maybe_emit_expr_attr_err ( attr) ;
0 commit comments