]> git.lizzy.rs Git - rust.git/blobdiff - src/matches.rs
Merge pull request #3510 from topecongiro/issue3509
[rust.git] / src / matches.rs
index 84fe1bdafe80a7971322090a07a8d1743aa66a8e..c09949cf2e86332245709aa3175d78b41d1b5685 100644 (file)
@@ -364,7 +364,8 @@ fn rewrite_match_body(
         shape.indent
     };
 
-    let forbid_same_line = has_guard && pats_str.contains('\n') && !is_empty_block;
+    let forbid_same_line =
+        (has_guard && pats_str.contains('\n') && !is_empty_block) || !body.attrs.is_empty();
 
     // Look for comments between `=>` and the start of the body.
     let arrow_comment = {