]> git.lizzy.rs Git - rust.git/blobdiff - tests/target/match.rs
Do not flatten match arm block with leading attributes
[rust.git] / tests / target / match.rs
index 92abda9752e805ee9543c0e19e65f6b7e4c73c39..1bf3fb758ee868379eeb9c22038b59d9c8bf33d6 100644 (file)
@@ -166,9 +166,15 @@ fn issue355() {
         a => println!("a", b),
         b => vec![1, 2],
         c => vec![3; 4],
-        d => println!("a", b),
-        e => vec![1, 2],
-        f => vec![3; 4],
+        d => {
+            println!("a", b)
+        }
+        e => {
+            vec![1, 2]
+        }
+        f => {
+            vec![3; 4]
+        }
         h => println!("a", b), // h comment
         i => vec![1, 2],       // i comment
         j => vec![3; 4],       // j comment
@@ -435,7 +441,6 @@ fn match_with_near_max_width() {
 
 fn match_with_trailing_spaces() {
     match x {
-        #![allow(simple_match)]
         Some(..) => 0,
         None => 1,
     }
@@ -603,3 +608,22 @@ fn issue_3774() {
         }
     }
 }
+
+// #4109
+fn issue_4109() {
+    match () {
+        _ => {
+            #[cfg(debug_assertions)]
+            {
+                println!("Foo");
+            }
+        }
+    }
+
+    match () {
+        _ => {
+            #[allow(unsafe_code)]
+            unsafe {}
+        }
+    }
+}