mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
Add missed case to typeck.ast_ty_to_ty, plus faux exhaustiveness check.
This commit is contained in:
parent
416d9bc0fd
commit
7e2f205866
@ -225,6 +225,13 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
|
||||
case (ast.ty_str) { sty = ty_str; }
|
||||
case (ast.ty_box(?t)) { sty = ty_box(ast_ty_to_ty(getter, t)); }
|
||||
case (ast.ty_vec(?t)) { sty = ty_vec(ast_ty_to_ty(getter, t)); }
|
||||
case (ast.ty_tup(?fields)) {
|
||||
let vec[tup(bool,@ty)] flds = vec();
|
||||
for (tup(bool, @ast.ty) field in fields) {
|
||||
flds += tup(field._0, ast_ty_to_ty(getter, field._1));
|
||||
}
|
||||
sty = ty_tup(flds);
|
||||
}
|
||||
|
||||
case (ast.ty_fn(?inputs, ?output)) {
|
||||
auto f = bind ast_arg_to_arg(getter, _);
|
||||
@ -244,6 +251,10 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
|
||||
sty = getter(def_id).struct;
|
||||
cname = some(path_to_str(path));
|
||||
}
|
||||
|
||||
case (_) {
|
||||
fail;
|
||||
}
|
||||
}
|
||||
|
||||
ret @rec(struct=sty, cname=cname);
|
||||
|
Loading…
Reference in New Issue
Block a user