@@ -278,14 +278,14 @@ impl<'a, 'tcx> Opt<'a, 'tcx> {
278
278
match * self {
279
279
ConstantValue ( ConstantExpr ( lit_expr) , _) => {
280
280
let lit_ty = ty:: node_id_to_type ( bcx. tcx ( ) , lit_expr. id ) ;
281
- let ( llval, _) = consts:: const_expr ( ccx, & * lit_expr) ;
281
+ let ( llval, _) = consts:: const_expr ( ccx, & * lit_expr, bcx . fcx . param_substs ) ;
282
282
let lit_datum = immediate_rvalue ( llval, lit_ty) ;
283
283
let lit_datum = unpack_datum ! ( bcx, lit_datum. to_appropriate_datum( bcx) ) ;
284
284
SingleResult ( Result :: new ( bcx, lit_datum. val ) )
285
285
}
286
286
ConstantRange ( ConstantExpr ( ref l1) , ConstantExpr ( ref l2) , _) => {
287
- let ( l1, _) = consts:: const_expr ( ccx, & * * l1) ;
288
- let ( l2, _) = consts:: const_expr ( ccx, & * * l2) ;
287
+ let ( l1, _) = consts:: const_expr ( ccx, & * * l1, bcx . fcx . param_substs ) ;
288
+ let ( l2, _) = consts:: const_expr ( ccx, & * * l2, bcx . fcx . param_substs ) ;
289
289
RangeResult ( Result :: new ( bcx, l1) , Result :: new ( bcx, l2) )
290
290
}
291
291
Variant ( disr_val, ref repr, _, _) => {
@@ -832,8 +832,8 @@ fn compare_values<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
832
832
833
833
let _icx = push_ctxt ( "compare_values" ) ;
834
834
if ty:: type_is_scalar ( rhs_t) {
835
- let rs = compare_scalar_types ( cx, lhs, rhs, rhs_t, ast:: BiEq , debug_loc) ;
836
- return Result :: new ( rs . bcx , rs . val ) ;
835
+ let cmp = compare_scalar_types ( cx, lhs, rhs, rhs_t, ast:: BiEq , debug_loc) ;
836
+ return Result :: new ( cx , cmp ) ;
837
837
}
838
838
839
839
match rhs_t. sty {
@@ -1163,29 +1163,16 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
1163
1163
}
1164
1164
RangeResult ( Result { val : vbegin, .. } ,
1165
1165
Result { bcx, val : vend } ) => {
1166
- let Result { bcx, val : llge } =
1167
- compare_scalar_types ( bcx,
1168
- test_val,
1169
- vbegin,
1170
- t,
1171
- ast:: BiGe ,
1172
- debug_loc) ;
1173
- let Result { bcx, val : llle } =
1174
- compare_scalar_types ( bcx,
1175
- test_val,
1176
- vend,
1177
- t,
1178
- ast:: BiLe ,
1179
- debug_loc) ;
1180
- Result :: new ( bcx, And ( bcx, llge, llle, debug_loc) )
1166
+ let llge = compare_scalar_types ( bcx, test_val, vbegin,
1167
+ t, ast:: BiGe , debug_loc) ;
1168
+ let llle = compare_scalar_types ( bcx, test_val, vend,
1169
+ t, ast:: BiLe , debug_loc) ;
1170
+ Result :: new ( bcx, And ( bcx, llge, llle, DebugLoc :: None ) )
1181
1171
}
1182
1172
LowerBound ( Result { bcx, val } ) => {
1183
- compare_scalar_types ( bcx,
1184
- test_val,
1185
- val,
1186
- t,
1187
- ast:: BiGe ,
1188
- debug_loc)
1173
+ Result :: new ( bcx, compare_scalar_types ( bcx, test_val,
1174
+ val, t, ast:: BiGe ,
1175
+ debug_loc) )
1189
1176
}
1190
1177
}
1191
1178
} ;
0 commit comments