Skip to content

Commit 259dffd

Browse files
committed
---
yaml --- r: 188334 b: refs/heads/master c: 46de12a h: refs/heads/master v: v3
1 parent 7f890b9 commit 259dffd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5d950bd37d9f4ef46798b79d38d9d91927bb0cf4
2+
refs/heads/master: 46de12ad0064e7879b1d8ce07e96e1e31274b881
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
55
refs/heads/try: 649d35e4d830b27806705dc5352c86ab6d6fd1a1

trunk/src/librustc_trans/trans/consts.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
462462

463463
ast::ExprIndex(ref base, ref index) => {
464464
let (bv, bt) = const_expr(cx, &**base, param_substs);
465-
let iv = match const_eval::eval_const_expr(cx.tcx(), &**index) {
466-
const_eval::const_int(i) => i as u64,
467-
const_eval::const_uint(u) => u,
465+
let iv = match const_eval::eval_const_expr_partial(cx.tcx(), &**index, None) {
466+
Ok(const_eval::const_int(i)) => i as u64,
467+
Ok(const_eval::const_uint(u)) => u,
468468
_ => cx.sess().span_bug(index.span,
469469
"index is not an integer-constant expression")
470470
};
@@ -650,9 +650,9 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
650650
ast::ExprRepeat(ref elem, ref count) => {
651651
let unit_ty = ty::sequence_element_type(cx.tcx(), ety);
652652
let llunitty = type_of::type_of(cx, unit_ty);
653-
let n = match const_eval::eval_const_expr(cx.tcx(), &**count) {
654-
const_eval::const_int(i) => i as uint,
655-
const_eval::const_uint(i) => i as uint,
653+
let n = match const_eval::eval_const_expr_partial(cx.tcx(), &**count, None) {
654+
Ok(const_eval::const_int(i)) => i as uint,
655+
Ok(const_eval::const_uint(i)) => i as uint,
656656
_ => cx.sess().span_bug(count.span, "count must be integral const expression.")
657657
};
658658
let unit_val = const_expr(cx, &**elem, param_substs).0;

0 commit comments

Comments
 (0)