]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/formatting.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / formatting.rs
index 3bea98acf2fb2ab78b5bd2ddc986d1de4e0d3dd1..b74f778b129dfb17344706756b60619d54bb9fd1 100644 (file)
 fn foo() -> bool { true }
 
 fn main() {
-    // weird `else if` formatting:
+    // weird `else` formatting:
+    if foo() {
+    } {
+    }
+
     if foo() {
     } if foo() {
     }
@@ -41,6 +45,17 @@ fn main() {
         let _ = 0;
     };
 
+    if foo() {
+    } else
+    {
+    }
+
+    if foo() {
+    }
+    else
+    {
+    }
+
     if foo() {
     } else
     if foo() { // the span of the above error should continue here
@@ -53,6 +68,20 @@ fn main() {
     }
 
     // those are ok:
+    if foo() {
+    }
+    {
+    }
+
+    if foo() {
+    } else {
+    }
+
+    if foo() {
+    }
+    else {
+    }
+
     if foo() {
     }
     if foo() {