Closed
Description
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.