Skip to content

Commit a8219c0

Browse files
committed
---
yaml --- r: 48083 b: refs/heads/incoming c: 347d199 h: refs/heads/master i: 48081: 8372af2 48079: c772c31 v: v3
1 parent 528343b commit a8219c0

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: d19cbf8da3b59393bdb9c06d8b03e558c7575dbd
9+
refs/heads/incoming: 347d19934db06f0467377ec138e7415a119f2a3c
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/librustc/middle/kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub fn check_expr(e: @expr, cx: Context, v: visit::vt<Context>) {
240240
"explicit copy requires a copyable argument");
241241
}
242242
expr_repeat(element, count_expr, _) => {
243-
let count = ty::eval_repeat_count(cx.tcx, count_expr, e.span);
243+
let count = ty::eval_repeat_count(cx.tcx, count_expr);
244244
if count > 1 {
245245
let element_ty = ty::expr_ty(cx.tcx, element);
246246
check_copy(cx, element_ty, element.span,

branches/incoming/src/librustc/middle/trans/tvec.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@ pub fn write_content(bcx: block,
410410
return expr::trans_into(bcx, element, Ignore);
411411
}
412412
SaveIn(lldest) => {
413-
let count = ty::eval_repeat_count(bcx.tcx(), count_expr,
414-
count_expr.span);
413+
let count = ty::eval_repeat_count(bcx.tcx(), count_expr);
415414
if count == 0 {
416415
return bcx;
417416
}
@@ -476,7 +475,7 @@ pub fn elements_required(bcx: block, content_expr: @ast::expr) -> uint {
476475
},
477476
ast::expr_vec(es, _) => es.len(),
478477
ast::expr_repeat(_, count_expr, _) => {
479-
ty::eval_repeat_count(bcx.tcx(), count_expr, content_expr.span)
478+
ty::eval_repeat_count(bcx.tcx(), count_expr)
480479
}
481480
_ => bcx.tcx().sess.span_bug(content_expr.span,
482481
~"Unexpected evec content")

branches/incoming/src/librustc/middle/ty.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4247,35 +4247,32 @@ pub fn normalize_ty(cx: ctxt, t: t) -> t {
42474247
}
42484248
42494249
// Returns the repeat count for a repeating vector expression.
4250-
pub fn eval_repeat_count(tcx: ctxt,
4251-
count_expr: @ast::expr,
4252-
span: span)
4253-
-> uint {
4250+
pub fn eval_repeat_count(tcx: ctxt, count_expr: @ast::expr) -> uint {
42544251
match const_eval::eval_const_expr_partial(tcx, count_expr) {
42554252
Ok(ref const_val) => match *const_val {
42564253
const_eval::const_int(count) => return count as uint,
42574254
const_eval::const_uint(count) => return count as uint,
42584255
const_eval::const_float(count) => {
4259-
tcx.sess.span_err(span,
4256+
tcx.sess.span_err(count_expr.span,
42604257
~"expected signed or unsigned integer for \
42614258
repeat count but found float");
42624259
return count as uint;
42634260
}
42644261
const_eval::const_str(_) => {
4265-
tcx.sess.span_err(span,
4262+
tcx.sess.span_err(count_expr.span,
42664263
~"expected signed or unsigned integer for \
42674264
repeat count but found string");
42684265
return 0;
42694266
}
42704267
const_eval::const_bool(_) => {
4271-
tcx.sess.span_err(span,
4268+
tcx.sess.span_err(count_expr.span,
42724269
~"expected signed or unsigned integer for \
42734270
repeat count but found boolean");
42744271
return 0;
42754272
}
42764273
},
42774274
Err(*) => {
4278-
tcx.sess.span_err(span,
4275+
tcx.sess.span_err(count_expr.span,
42794276
~"expected constant integer for repeat count \
42804277
but found variable");
42814278
return 0;

branches/incoming/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
21572157
ty::mk_evec(tcx, ty::mt {ty: t, mutbl: mutability}, tt)
21582158
}
21592159
ast::expr_repeat(element, count_expr, mutbl) => {
2160-
let count = ty::eval_repeat_count(tcx, count_expr, expr.span);
2160+
let count = ty::eval_repeat_count(tcx, count_expr);
21612161
fcx.write_ty(count_expr.id, ty::mk_uint(tcx));
21622162
let tt = ast_expr_vstore_to_vstore(fcx, ev, count, vst);
21632163
let t: ty::t = fcx.infcx().next_ty_var();
@@ -2484,7 +2484,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
24842484
fcx.write_ty(id, typ);
24852485
}
24862486
ast::expr_repeat(element, count_expr, mutbl) => {
2487-
let count = ty::eval_repeat_count(tcx, count_expr, expr.span);
2487+
let count = ty::eval_repeat_count(tcx, count_expr);
24882488
fcx.write_ty(count_expr.id, ty::mk_uint(tcx));
24892489
let t: ty::t = fcx.infcx().next_ty_var();
24902490
bot |= check_expr_has_type(fcx, element, t);

0 commit comments

Comments
 (0)