about summary refs log tree commit diff
path: root/tests/ui/expr/if/if-without-block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/expr/if/if-without-block.rs')
-rw-r--r--tests/ui/expr/if/if-without-block.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/expr/if/if-without-block.rs b/tests/ui/expr/if/if-without-block.rs
new file mode 100644
index 00000000000..5add9dfda4b
--- /dev/null
+++ b/tests/ui/expr/if/if-without-block.rs
@@ -0,0 +1,7 @@
+fn main() {
+    let n = 1;
+    if 5 == {
+    //~^ ERROR this `if` expression is missing a block after the condition
+        println!("five");
+    }
+}