@@ -43,7 +43,6 @@ use crate::common::eq::SpanlessEq;
43
43
use crate :: common:: parse;
44
44
use quote:: ToTokens ;
45
45
use rustc_ast:: ast;
46
- use rustc_ast:: ptr:: P ;
47
46
use rustc_ast_pretty:: pprust;
48
47
use rustc_span:: edition:: Edition ;
49
48
use std:: fs;
@@ -197,11 +196,11 @@ fn test_expressions(path: &Path, edition: Edition, exprs: Vec<syn::Expr>) -> (us
197
196
( passed, failed)
198
197
}
199
198
200
- fn librustc_parse_and_rewrite ( input : & str ) -> Option < P < ast:: Expr > > {
199
+ fn librustc_parse_and_rewrite ( input : & str ) -> Option < Box < ast:: Expr > > {
201
200
parse:: librustc_expr ( input) . map ( librustc_parenthesize)
202
201
}
203
202
204
- fn librustc_parenthesize ( mut librustc_expr : P < ast:: Expr > ) -> P < ast:: Expr > {
203
+ fn librustc_parenthesize ( mut librustc_expr : Box < ast:: Expr > ) -> Box < ast:: Expr > {
205
204
use rustc_ast:: ast:: {
206
205
AssocItem , AssocItemKind , Attribute , BinOpKind , Block , BoundConstness , Expr , ExprField ,
207
206
ExprKind , GenericArg , GenericBound , Local , LocalKind , Pat , PolyTraitRef , Stmt , StmtKind ,
@@ -276,7 +275,7 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
276
275
}
277
276
278
277
impl MutVisitor for FullyParenthesize {
279
- fn visit_expr ( & mut self , e : & mut P < Expr > ) {
278
+ fn visit_expr ( & mut self , e : & mut Box < Expr > ) {
280
279
noop_visit_expr ( e, self ) ;
281
280
match e. kind {
282
281
ExprKind :: Block ( ..) | ExprKind :: If ( ..) | ExprKind :: Let ( ..) => { }
@@ -346,9 +345,9 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
346
345
347
346
fn flat_map_assoc_item (
348
347
& mut self ,
349
- item : P < AssocItem > ,
348
+ item : Box < AssocItem > ,
350
349
ctxt : AssocCtxt ,
351
- ) -> SmallVec < [ P < AssocItem > ; 1 ] > {
350
+ ) -> SmallVec < [ Box < AssocItem > ; 1 ] > {
352
351
match & item. kind {
353
352
AssocItemKind :: Const ( const_item)
354
353
if !const_item. generics . params . is_empty ( )
@@ -363,11 +362,11 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
363
362
// We don't want to look at expressions that might appear in patterns or
364
363
// types yet. We'll look into comparing those in the future. For now
365
364
// focus on expressions appearing in other places.
366
- fn visit_pat ( & mut self , pat : & mut P < Pat > ) {
365
+ fn visit_pat ( & mut self , pat : & mut Box < Pat > ) {
367
366
let _ = pat;
368
367
}
369
368
370
- fn visit_ty ( & mut self , ty : & mut P < Ty > ) {
369
+ fn visit_ty ( & mut self , ty : & mut Box < Ty > ) {
371
370
let _ = ty;
372
371
}
373
372
0 commit comments