about summary refs log tree commit diff
path: root/src/expr.rs
diff options
context:
space:
mode:
authorScyptnex <scyptnex@tzeidn.com>2015-09-24 12:01:48 +1000
committerScyptnex <scyptnex@tzeidn.com>2015-09-24 12:01:48 +1000
commitf1dfab5a29bb86690ae56ce07c928104b59ae2d0 (patch)
treed14a2af0a3c10e99417743162e48c5bb59dd5a67 /src/expr.rs
parente176dc97febb860a5947aea6d0625b8a123b3484 (diff)
fix for #355 and test cases
Diffstat (limited to 'src/expr.rs')
-rw-r--r--src/expr.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/expr.rs b/src/expr.rs
index c633f59f21b..e38476df6fd 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -151,7 +151,11 @@ impl Rewrite for ast::Expr {
                 rewrite_chain(self, context, width, offset)
             }
             ast::Expr_::ExprMac(ref mac) => {
-                rewrite_macro(mac, context, width, offset)
+                // Failure to rewrite a marco should not imply failure to rewrite the Expr
+                rewrite_macro(mac, context, width, offset).or(wrap_str(context.snippet(self.span),
+                                                                       context.config.max_width,
+                                                                       width,
+                                                                       offset))
             }
             // We do not format these expressions yet, but they should still
             // satisfy our width restrictions.