Revert "rustc: Add support for folding over tag types" as it's unnecessary. Oops.

This commit is contained in:
Patrick Walton 2011-03-03 17:09:20 -08:00
parent f6682280f3
commit 04a0a6fbef
3 changed files with 1 additions and 15 deletions

View File

@ -1144,8 +1144,6 @@ fn linearize_ty_params(@block_ctxt cx, @ty.t t)
}
ret t;
}
fn fold_tag_ty(@ty.t t) -> @ty.t { ret t; }
}

View File

@ -294,7 +294,6 @@ fn ty_to_str(&@t typ) -> str {
type ty_fold = state obj {
fn fold_simple_ty(@t ty) -> @t;
fn fold_tag_ty(@t ty) -> @t;
};
fn fold_ty(ty_fold fld, @t ty) -> @t {
@ -323,8 +322,7 @@ fn fold_ty(ty_fold fld, @t ty) -> @t {
for (@t subty in subtys) {
new_subtys += vec(fold_ty(fld, subty));
}
auto typ = rewrap(ty, ty_tag(tid, new_subtys));
ret fld.fold_tag_ty(typ);
ret rewrap(ty, ty_tag(tid, new_subtys));
}
case (ty_tup(?subtys)) {
let vec[@t] new_subtys = vec();
@ -613,8 +611,6 @@ fn count_ty_params(@t ty) -> uint {
}
ret ty;
}
fn fold_tag_ty(@t ty) -> @t { ret ty; }
}
let vec[ast.def_id] param_ids_inner = vec();
@ -1433,8 +1429,6 @@ fn unify(@ty.t expected, @ty.t actual, &unify_handler handler)
}
}
}
fn fold_tag_ty(@t typ) -> @t { ret typ; }
}
ret ty.fold_ty(folder(bindings), typ);
@ -1554,8 +1548,6 @@ fn replace_type_params(@t typ, hashmap[ast.def_id,@t] param_map) -> @t {
}
}
}
fn fold_tag_ty(@t typ) -> @t { ret typ; }
}
auto replacer = param_replacer(param_map);
ret fold_ty(replacer, typ);

View File

@ -73,8 +73,6 @@ fn generalize_ty(@crate_ctxt cx, @ty.t t) -> @ty.t {
}
ret t;
}
fn fold_tag_ty(@ty.t t) -> @ty.t { ret t; }
}
auto generalizer = ty_generalizer(cx, @common.new_def_hash[@ty.t]());
@ -116,8 +114,6 @@ fn substitute_ty_params(&@crate_ctxt ccx,
case (_) { ret typ; }
}
}
fn fold_tag_ty(@ty.t typ) -> @ty.t { ret typ; }
}
fn hash_int(&int x) -> uint { ret x as uint; }