Skip to content

Commit 4e658cc

Browse files
committed
Remove box_syntax from AST and use in tools
1 parent a5ba6e0 commit 4e658cc

File tree

4 files changed

+0
-9
lines changed

4 files changed

+0
-9
lines changed

src/closures.rs

-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ fn rewrite_closure_expr(
195195
| ast::ExprKind::Struct(..) => true,
196196

197197
ast::ExprKind::AddrOf(_, _, ref expr)
198-
| ast::ExprKind::Box(ref expr)
199198
| ast::ExprKind::Try(ref expr)
200199
| ast::ExprKind::Unary(_, ref expr)
201200
| ast::ExprKind::Cast(ref expr, _) => allow_multi_line(expr),
@@ -441,7 +440,6 @@ fn is_block_closure_forced_inner(expr: &ast::Expr, version: Version) -> bool {
441440
ast::ExprKind::If(..) | ast::ExprKind::While(..) | ast::ExprKind::ForLoop(..) => true,
442441
ast::ExprKind::Loop(..) if version == Version::Two => true,
443442
ast::ExprKind::AddrOf(_, _, ref expr)
444-
| ast::ExprKind::Box(ref expr)
445443
| ast::ExprKind::Try(ref expr)
446444
| ast::ExprKind::Unary(_, ref expr)
447445
| ast::ExprKind::Cast(ref expr, _) => is_block_closure_forced_inner(expr, version),

src/expr.rs

-5
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ pub(crate) fn format_expr(
236236
ast::ExprKind::Yeet(Some(ref expr)) => {
237237
rewrite_unary_prefix(context, "do yeet ", &**expr, shape)
238238
}
239-
ast::ExprKind::Box(ref expr) => rewrite_unary_prefix(context, "box ", &**expr, shape),
240239
ast::ExprKind::AddrOf(borrow_kind, mutability, ref expr) => {
241240
rewrite_expr_addrof(context, borrow_kind, mutability, expr, shape)
242241
}
@@ -1299,7 +1298,6 @@ pub(crate) fn is_simple_expr(expr: &ast::Expr) -> bool {
12991298
ast::ExprKind::Lit(..) => true,
13001299
ast::ExprKind::Path(ref qself, ref path) => qself.is_none() && path.segments.len() <= 1,
13011300
ast::ExprKind::AddrOf(_, _, ref expr)
1302-
| ast::ExprKind::Box(ref expr)
13031301
| ast::ExprKind::Cast(ref expr, _)
13041302
| ast::ExprKind::Field(ref expr, _)
13051303
| ast::ExprKind::Try(ref expr)
@@ -1361,7 +1359,6 @@ pub(crate) fn can_be_overflowed_expr(
13611359

13621360
// Handle unary-like expressions
13631361
ast::ExprKind::AddrOf(_, _, ref expr)
1364-
| ast::ExprKind::Box(ref expr)
13651362
| ast::ExprKind::Try(ref expr)
13661363
| ast::ExprKind::Unary(_, ref expr)
13671364
| ast::ExprKind::Cast(ref expr, _) => can_be_overflowed_expr(context, expr, args_len),
@@ -1373,7 +1370,6 @@ pub(crate) fn is_nested_call(expr: &ast::Expr) -> bool {
13731370
match expr.kind {
13741371
ast::ExprKind::Call(..) | ast::ExprKind::MacCall(..) => true,
13751372
ast::ExprKind::AddrOf(_, _, ref expr)
1376-
| ast::ExprKind::Box(ref expr)
13771373
| ast::ExprKind::Try(ref expr)
13781374
| ast::ExprKind::Unary(_, ref expr)
13791375
| ast::ExprKind::Cast(ref expr, _) => is_nested_call(expr),
@@ -2133,7 +2129,6 @@ pub(crate) fn is_method_call(expr: &ast::Expr) -> bool {
21332129
match expr.kind {
21342130
ast::ExprKind::MethodCall(..) => true,
21352131
ast::ExprKind::AddrOf(_, _, ref expr)
2136-
| ast::ExprKind::Box(ref expr)
21372132
| ast::ExprKind::Cast(ref expr, _)
21382133
| ast::ExprKind::Try(ref expr)
21392134
| ast::ExprKind::Unary(_, ref expr) => is_method_call(expr),

src/matches.rs

-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ fn can_flatten_block_around_this(body: &ast::Expr) -> bool {
592592
| ast::ExprKind::Struct(..)
593593
| ast::ExprKind::Tup(..) => true,
594594
ast::ExprKind::AddrOf(_, _, ref expr)
595-
| ast::ExprKind::Box(ref expr)
596595
| ast::ExprKind::Try(ref expr)
597596
| ast::ExprKind::Unary(_, ref expr)
598597
| ast::ExprKind::Index(ref expr, _)

src/utils.rs

-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
492492
| ast::ExprKind::Assign(..)
493493
| ast::ExprKind::AssignOp(..)
494494
| ast::ExprKind::Await(..)
495-
| ast::ExprKind::Box(..)
496495
| ast::ExprKind::Break(..)
497496
| ast::ExprKind::Cast(..)
498497
| ast::ExprKind::Continue(..)

0 commit comments

Comments
 (0)