Add test for if without else cannot return result
This commit is contained in:
parent
413d97f8bd
commit
9375204461
1 changed files with 6 additions and 0 deletions
6
src/test/compile-fail/if-without-else-result.rs
Normal file
6
src/test/compile-fail/if-without-else-result.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// error-pattern:`if` without `else` can not produce a result
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let a = if true { true };
|
||||||
|
log a;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue