From bc0dd2c68dd5adf4bd4b512b186d59b5112e0376 Mon Sep 17 00:00:00 2001 From: Marcus Klaas Date: Fri, 25 Sep 2015 13:25:52 +0200 Subject: [PATCH] Adjust for changed representation of box expressions in AST --- src/expr.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index a2be6ee8fd1..ef6ef12b96d 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -163,12 +163,15 @@ impl Rewrite for ast::Expr { ast::Expr_::ExprRet(Some(ref expr)) => { rewrite_unary_prefix(context, "return ", &expr, width, offset) } + ast::Expr_::ExprBox(ref expr) => { + rewrite_unary_prefix(context, "box ", &expr, width, offset) + } ast::Expr_::ExprAddrOf(mutability, ref expr) => { rewrite_expr_addrof(context, mutability, &expr, width, offset) } // We do not format these expressions yet, but they should still // satisfy our width restrictions. - ast::Expr_::ExprBox(..) | + ast::Expr_::ExprInPlace(..) | ast::Expr_::ExprCast(..) | ast::Expr_::ExprIndex(..) | ast::Expr_::ExprInlineAsm(..) | @@ -1348,7 +1351,6 @@ fn rewrite_unary_op(context: &RewriteContext, -> Option { // For some reason, an UnOp is not spanned like BinOp! let operator_str = match *op { - ast::UnOp::UnUniq => "box ", ast::UnOp::UnDeref => "*", ast::UnOp::UnNot => "!", ast::UnOp::UnNeg => "-",