From ed597a8059f4e04d2ab7caa9afd1b0ee8f66095c Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 23 Sep 2015 22:51:37 -0700 Subject: [PATCH] Exhaustively enumerate expressions in expression rewriting. --- src/expr.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index 7bcf613b2e5..c1749668c57 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -155,7 +155,15 @@ impl Rewrite for ast::Expr { } // We do not format these expressions yet, but they should still // satisfy our width restrictions. - _ => wrap_str(context.snippet(self.span), context.config.max_width, width, offset), + ast::Expr_::ExprBox(..) | + ast::Expr_::ExprCast(..) | + ast::Expr_::ExprIndex(..) | + ast::Expr_::ExprAddrOf(..) | + ast::Expr_::ExprRet(..) | + ast::Expr_::ExprInlineAsm(..) | + ast::Expr_::ExprRepeat(..) => { + wrap_str(context.snippet(self.span), context.config.max_width, width, offset) + } } } }