auto merge of #6206 : sanxiyn/rust/mach-sty, r=thestinger

This commit is contained in:
bors 2013-05-02 21:42:36 -07:00
commit 87c46b548a
2 changed files with 2 additions and 20 deletions

View file

@ -1253,16 +1253,6 @@ pub fn mk_opaque_closure_ptr(cx: ctxt, sigil: ast::Sigil) -> t {
pub fn mk_opaque_box(cx: ctxt) -> t { mk_t(cx, ty_opaque_box) }
// Converts s to its machine type equivalent
pub fn mach_sty(cfg: @session::config, t: t) -> sty {
match get(t).sty {
ty_int(ast::ty_i) => ty_int(cfg.int_type),
ty_uint(ast::ty_u) => ty_uint(cfg.uint_type),
ty_float(ast::ty_f) => ty_float(cfg.float_type),
ref s => (/*bad*/copy *s)
}
}
pub fn walk_ty(ty: t, f: &fn(t)) {
maybe_walk_ty(ty, |t| { f(t); true });
}

View file

@ -480,6 +480,8 @@ pub fn super_tys<C:Combine>(
unify_float_variable(self, !self.a_is_expected(), v_id, v)
}
(ty::ty_nil, _) |
(ty::ty_bool, _) |
(ty::ty_int(_), _) |
(ty::ty_uint(_), _) |
(ty::ty_float(_), _) => {
@ -490,16 +492,6 @@ pub fn super_tys<C:Combine>(
}
}
(ty::ty_nil, _) |
(ty::ty_bool, _) => {
let cfg = tcx.sess.targ_cfg;
if ty::mach_sty(cfg, a) == ty::mach_sty(cfg, b) {
Ok(a)
} else {
Err(ty::terr_sorts(expected_found(self, a, b)))
}
}
(ty::ty_param(ref a_p), ty::ty_param(ref b_p)) if a_p.idx == b_p.idx => {
Ok(a)
}