]> git.lizzy.rs Git - rust.git/commitdiff
Remove mach_sty
authorSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 30 Apr 2013 18:27:14 +0000 (03:27 +0900)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Tue, 30 Apr 2013 18:27:14 +0000 (03:27 +0900)
src/librustc/middle/ty.rs
src/librustc/middle/typeck/infer/combine.rs

index c7fb1e94adf4cea2f010d754d12ea81c35bc441a..df507f012d626af23c7af842809bd0cc2d425274 100644 (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 });
 }
index e4db423c2e35c14597adbc1d58620cd108a92312..de3ffcd63ab7c056102d48b385fcca2a2ef435d0 100644 (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)
       }