Verify that an if condition block returns a value

This commit is contained in:
Esteban Küber 2017-08-17 16:51:52 -07:00
parent 20a2716206
commit f06323337d
4 changed files with 51 additions and 5 deletions

View file

@ -10,7 +10,16 @@
fn main() {
if true {
} else if { //ERROR: MISSING CONDITIONAL
} else if {
} else {
};
}
}
fn foo() {
if true {
} else if {
}
bar();
}
fn bar() {}

View file

@ -1,8 +1,14 @@
error: missing condition for `if` statemement
--> $DIR/issue-13483.rs:13:14
|
13 | } else if { //ERROR: MISSING CONDITIONAL
13 | } else if {
| ^ expected if condition here
error: aborting due to previous error
error: missing condition for `if` statemement
--> $DIR/issue-13483.rs:20:14
|
20 | } else if {
| ^ expected if condition here
error: aborting due to 2 previous errors