Skip to content

Commit 9921b7c

Browse files
committed
---
yaml --- r: 195753 b: refs/heads/auto c: 2243a2c h: refs/heads/master i: 195751: 94f3951 v: v3
1 parent aca1396 commit 9921b7c

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1973f7ebe5c67ef9ed57f7a64781d13868a70d3d
13+
refs/heads/auto: 2243a2cceddd6c9708e3d296b5375da72a6b3d2a
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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)