Add test for if without else cannot return result
This commit is contained in:
parent
413d97f8bd
commit
9375204461
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…
x
Reference in New Issue
Block a user