Skip to content

Commit 88877fb

Browse files
committed
---
yaml --- r: 195999 b: refs/heads/beta c: 2243a2c h: refs/heads/master i: 195997: d6e3a1f 195995: 2eb5b24 195991: 6e60b9a 195983: 8088fc4 195967: b945c1f v: v3
1 parent a8e66d4 commit 88877fb

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 1973f7ebe5c67ef9ed57f7a64781d13868a70d3d
32+
refs/heads/beta: 2243a2cceddd6c9708e3d296b5375da72a6b3d2a
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 9de34a84bb300bab1bf0227f577331620cd60511

branches/beta/src/librustc_trans/trans/consts.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -772,19 +772,7 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
772772
ast::ExprRepeat(ref elem, ref count) => {
773773
let unit_ty = ty::sequence_element_type(cx.tcx(), ety);
774774
let llunitty = type_of::type_of(cx, unit_ty);
775-
let n = match const_eval::eval_const_expr_partial(cx.tcx(), &**count, None) {
776-
Ok(const_eval::const_int(i)) => i as usize,
777-
Ok(const_eval::const_uint(i)) => i as usize,
778-
Ok(_) => {
779-
cx.sess().span_bug(count.span, "count must be integral const expression.")
780-
}
781-
Err(err) => {
782-
cx.sess().span_err(count.span, &format!("error evaluating count: {}",
783-
err.description()));
784-
// return 1 to allow compilation to proceed
785-
1 as usize
786-
}
787-
};
775+
let n = ty::eval_repeat_count(cx.tcx(), count);
788776
let unit_val = const_expr(cx, &**elem, param_substs).0;
789777
let vs: Vec<_> = repeat(unit_val).take(n).collect();
790778
if val_ty(unit_val) != llunitty {

0 commit comments

Comments
 (0)