mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Missing semicolon in type.ml, plus test to catch regression. Closes #113.
This commit is contained in:
parent
2141154c85
commit
bacb8e6b79
@ -771,7 +771,7 @@ let check_stmt (cx:Semant.ctxt) : (fn_ctx -> Ast.stmt -> unit) =
|
||||
| Ast.STMT_ret (Some atom) ->
|
||||
if fn_ctx.fnctx_is_iter then
|
||||
Common.err None
|
||||
"iterators can't return values; did you mean 'put'?"
|
||||
"iterators can't return values; did you mean 'put'?";
|
||||
demand fn_ctx.fnctx_return_type (check_atom atom)
|
||||
|
||||
| Ast.STMT_ret None ->
|
||||
|
7
src/test/compile-fail/wrong-ret-type.rs
Normal file
7
src/test/compile-fail/wrong-ret-type.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// error-pattern: mismatched types
|
||||
fn mk_int() -> uint {
|
||||
let int i = 3;
|
||||
ret i;
|
||||
}
|
||||
fn main() {
|
||||
}
|
Loading…
Reference in New Issue
Block a user