@@ -462,9 +462,9 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
462
462
463
463
ast:: ExprIndex ( ref base, ref index) => {
464
464
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,
468
468
_ => cx. sess ( ) . span_bug ( index. span ,
469
469
"index is not an integer-constant expression" )
470
470
} ;
@@ -650,9 +650,9 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
650
650
ast:: ExprRepeat ( ref elem, ref count) => {
651
651
let unit_ty = ty:: sequence_element_type ( cx. tcx ( ) , ety) ;
652
652
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 ,
656
656
_ => cx. sess ( ) . span_bug ( count. span , "count must be integral const expression." )
657
657
} ;
658
658
let unit_val = const_expr ( cx, & * * elem, param_substs) . 0 ;
0 commit comments