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 });
}
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(_), _) => {
}
}
- (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)
}