be5537e95f
Blocks (or statements involving blocks) that end in a semicolon are no longer considered the block-expression of their outer block. This used to be an expression block, but now is a statement block: { if foo { ret 1; } else { ret 10; } } This helps clear up some ambiguities in our grammar.
10 lines
210 B
Rust
10 lines
210 B
Rust
// error-pattern: not all control paths return a value
|
|
|
|
fn f() -> int {
|
|
// Make sure typestate doesn't interpret this alt expression
|
|
// as the function result
|
|
alt true { true { } }
|
|
}
|
|
|
|
fn main() { }
|