From 97109aa51b46215b47a12b9e596ca61b9ed801c9 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Wed, 1 May 2013 03:27:14 +0900 Subject: [PATCH] Remove mach_sty --- src/librustc/middle/ty.rs | 10 ---------- src/librustc/middle/typeck/infer/combine.rs | 12 ++---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index c7fb1e94adf..df507f012d6 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -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 }); } diff --git a/src/librustc/middle/typeck/infer/combine.rs b/src/librustc/middle/typeck/infer/combine.rs index e4db423c2e3..de3ffcd63ab 100644 --- a/src/librustc/middle/typeck/infer/combine.rs +++ b/src/librustc/middle/typeck/infer/combine.rs @@ -480,6 +480,8 @@ pub fn super_tys( 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( } } - (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) }