Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down
12 changes: 2 additions & 10 deletions src/librustc/middle/typeck/infer/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_), _) => {
Expand All @@ -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)
}
Expand Down