Skip to content

Commit 70fe491

Browse files
jdmbrson
authored andcommitted
---
yaml --- r: 3562 b: refs/heads/master c: 7e7e326 h: refs/heads/master v: v3
1 parent dea90da commit 70fe491

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: a2775a5b72b7cad1bfe2a480a79bfe48281dd40f
2+
refs/heads/master: 7e7e326ee672e7540ae7274dc5cc96d6af909b6c

trunk/src/comp/middle/typeck.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ fn type_is_scalar(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool {
229229
ret ty::type_is_scalar(fcx.ccx.tcx, typ_s);
230230
}
231231

232-
fn type_is_str(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool {
233-
auto typ_s = structurally_resolved_type(fcx, sp, typ);
234-
ret ty::type_is_str(fcx.ccx.tcx, typ_s);
235-
}
236-
237232

238233
// Parses the programmer's textual representation of a type into our internal
239234
// 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) {
16671662
check_expr(fcx, e);
16681663
auto tcx = fcx.ccx.tcx;
16691664
auto ety = expr_ty(tcx, e);
1670-
if (!type_is_str(fcx, e.span, ety)) {
1671-
tcx.sess.span_fatal(e.span,
1672-
#fmt("mismatched types: expected \
1673-
str, found %s",
1674-
ty_to_str(tcx, ety)));
1675-
}
1665+
demand::simple(fcx, e.span, ty::mk_str(tcx), ety);
16761666
}
16771667
}
16781668
write::bot_ty(fcx.ccx.tcx, id);

0 commit comments

Comments
 (0)