diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 6fbe6493061e..41a2daf0e448 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -229,11 +229,6 @@ fn type_is_scalar(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool { ret ty::type_is_scalar(fcx.ccx.tcx, typ_s); } -fn type_is_str(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool { - auto typ_s = structurally_resolved_type(fcx, sp, typ); - ret ty::type_is_str(fcx.ccx.tcx, typ_s); -} - // Parses the programmer's textual representation of a type into our internal // notion of a type. `getter` is a function that returns the type @@ -1667,12 +1662,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) { check_expr(fcx, e); auto tcx = fcx.ccx.tcx; auto ety = expr_ty(tcx, e); - if (!type_is_str(fcx, e.span, ety)) { - tcx.sess.span_fatal(e.span, - #fmt("mismatched types: expected \ - str, found %s", - ty_to_str(tcx, ety))); - } + demand::simple(fcx, e.span, ty::mk_str(tcx), ety); } } write::bot_ty(fcx.ccx.tcx, id);