@@ -1768,7 +1768,7 @@ impl InvocationCollectorNode for ast::Crate {
1768
1768
}
1769
1769
}
1770
1770
1771
- impl InvocationCollectorNode for P < ast:: Ty > {
1771
+ impl InvocationCollectorNode for ast:: Ty {
1772
1772
type OutputTy = P < ast:: Ty > ;
1773
1773
const KIND : AstFragmentKind = AstFragmentKind :: Ty ;
1774
1774
fn to_annotatable ( self ) -> Annotatable {
@@ -1791,7 +1791,7 @@ impl InvocationCollectorNode for P<ast::Ty> {
1791
1791
}
1792
1792
}
1793
1793
1794
- impl InvocationCollectorNode for P < ast:: Pat > {
1794
+ impl InvocationCollectorNode for ast:: Pat {
1795
1795
type OutputTy = P < ast:: Pat > ;
1796
1796
const KIND : AstFragmentKind = AstFragmentKind :: Pat ;
1797
1797
fn to_annotatable ( self ) -> Annotatable {
@@ -1814,11 +1814,11 @@ impl InvocationCollectorNode for P<ast::Pat> {
1814
1814
}
1815
1815
}
1816
1816
1817
- impl InvocationCollectorNode for P < ast:: Expr > {
1817
+ impl InvocationCollectorNode for ast:: Expr {
1818
1818
type OutputTy = P < ast:: Expr > ;
1819
1819
const KIND : AstFragmentKind = AstFragmentKind :: Expr ;
1820
1820
fn to_annotatable ( self ) -> Annotatable {
1821
- Annotatable :: Expr ( self )
1821
+ Annotatable :: Expr ( P ( self ) )
1822
1822
}
1823
1823
fn fragment_to_output ( fragment : AstFragment ) -> Self :: OutputTy {
1824
1824
fragment. make_expr ( )
@@ -1955,37 +1955,37 @@ impl DummyAstNode for ast::Crate {
1955
1955
}
1956
1956
}
1957
1957
1958
- impl DummyAstNode for P < ast:: Ty > {
1958
+ impl DummyAstNode for ast:: Ty {
1959
1959
fn dummy ( ) -> Self {
1960
- P ( ast:: Ty {
1960
+ ast:: Ty {
1961
1961
id : DUMMY_NODE_ID ,
1962
1962
kind : TyKind :: Dummy ,
1963
1963
span : Default :: default ( ) ,
1964
1964
tokens : Default :: default ( ) ,
1965
- } )
1965
+ }
1966
1966
}
1967
1967
}
1968
1968
1969
- impl DummyAstNode for P < ast:: Pat > {
1969
+ impl DummyAstNode for ast:: Pat {
1970
1970
fn dummy ( ) -> Self {
1971
- P ( ast:: Pat {
1971
+ ast:: Pat {
1972
1972
id : DUMMY_NODE_ID ,
1973
1973
kind : PatKind :: Wild ,
1974
1974
span : Default :: default ( ) ,
1975
1975
tokens : Default :: default ( ) ,
1976
- } )
1976
+ }
1977
1977
}
1978
1978
}
1979
1979
1980
- impl DummyAstNode for P < ast:: Expr > {
1980
+ impl DummyAstNode for ast:: Expr {
1981
1981
fn dummy ( ) -> Self {
1982
1982
ast:: Expr :: dummy ( )
1983
1983
}
1984
1984
}
1985
1985
1986
1986
impl DummyAstNode for AstNodeWrapper < P < ast:: Expr > , MethodReceiverTag > {
1987
1987
fn dummy ( ) -> Self {
1988
- AstNodeWrapper :: new ( ast:: Expr :: dummy ( ) , MethodReceiverTag )
1988
+ AstNodeWrapper :: new ( P ( ast:: Expr :: dummy ( ) ) , MethodReceiverTag )
1989
1989
}
1990
1990
}
1991
1991
@@ -2272,7 +2272,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
2272
2272
}
2273
2273
}
2274
2274
2275
- fn visit_node < Node : InvocationCollectorNode < OutputTy = Node > + DummyAstNode > (
2275
+ fn visit_node < Node : InvocationCollectorNode < OutputTy : Into < Node > > + DummyAstNode > (
2276
2276
& mut self ,
2277
2277
node : & mut Node ,
2278
2278
) {
@@ -2297,14 +2297,15 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
2297
2297
* node = self
2298
2298
. collect_attr ( ( attr, pos, derives) , n. to_annotatable ( ) , Node :: KIND )
2299
2299
. make_ast :: < Node > ( )
2300
+ . into ( )
2300
2301
}
2301
2302
} ,
2302
2303
None if node. is_mac_call ( ) => {
2303
2304
let n = mem:: replace ( node, Node :: dummy ( ) ) ;
2304
2305
let ( mac, attrs, _) = n. take_mac_call ( ) ;
2305
2306
self . check_attributes ( & attrs, & mac) ;
2306
2307
2307
- * node = self . collect_bang ( mac, Node :: KIND ) . make_ast :: < Node > ( )
2308
+ * node = self . collect_bang ( mac, Node :: KIND ) . make_ast :: < Node > ( ) . into ( )
2308
2309
}
2309
2310
None if node. delegation ( ) . is_some ( ) => unreachable ! ( ) ,
2310
2311
None => {
@@ -2414,15 +2415,15 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
2414
2415
self . visit_node ( node)
2415
2416
}
2416
2417
2417
- fn visit_ty ( & mut self , node : & mut P < ast:: Ty > ) {
2418
+ fn visit_ty ( & mut self , node : & mut ast:: Ty ) {
2418
2419
self . visit_node ( node)
2419
2420
}
2420
2421
2421
- fn visit_pat ( & mut self , node : & mut P < ast:: Pat > ) {
2422
+ fn visit_pat ( & mut self , node : & mut ast:: Pat ) {
2422
2423
self . visit_node ( node)
2423
2424
}
2424
2425
2425
- fn visit_expr ( & mut self , node : & mut P < ast:: Expr > ) {
2426
+ fn visit_expr ( & mut self , node : & mut ast:: Expr ) {
2426
2427
// FIXME: Feature gating is performed inconsistently between `Expr` and `OptExpr`.
2427
2428
if let Some ( attr) = node. attrs . first ( ) {
2428
2429
self . cfg ( ) . maybe_emit_expr_attr_err ( attr) ;
0 commit comments