graydon/rust — Issue #1481: better error message when there is a missing semicolon with an expression
Author: nikomatsakis
Created: 2012-01-10 17:28:39+00:00
State: open

Something like:

```
fn foo() {
task::spawn {|| } //! ERROR type mismatch: expected '()' but got 'tast'
bar();
}

fn bar() {
}
```

will yield an error something like the one above. It would be better if it said, "statement with non-unit return type requires a semicolon" or something like that. This would be easy-ish to fix: the ast has a type "stmt_expr" and "stmt_semi", and "stmt_expr" must have a unit type.