Verify that an if condition block returns a value
This commit is contained in:
parent
20a2716206
commit
f06323337d
4 changed files with 51 additions and 5 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue