about summary refs log tree commit diff
path: root/tests/ui/expr/if/if-without-else-result.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/expr/if/if-without-else-result.rs')
-rw-r--r--tests/ui/expr/if/if-without-else-result.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/expr/if/if-without-else-result.rs b/tests/ui/expr/if/if-without-else-result.rs
new file mode 100644
index 00000000000..95604758a6b
--- /dev/null
+++ b/tests/ui/expr/if/if-without-else-result.rs
@@ -0,0 +1,6 @@
+fn main() {
+    let a = if true { true };
+    //~^ ERROR `if` may be missing an `else` clause [E0317]
+    //~| expected `bool`, found `()`
+    println!("{}", a);
+}