@@ -66,15 +66,13 @@ pub(crate) fn eval_promoted<'a, 'mir, 'tcx>(
66
66
pub fn op_to_const < ' tcx > (
67
67
ecx : & CompileTimeEvalContext < ' _ , ' _ , ' tcx > ,
68
68
op : OpTy < ' tcx > ,
69
- may_normalize : bool ,
70
69
) -> EvalResult < ' tcx , ty:: Const < ' tcx > > {
71
70
// We do not normalize just any data. Only scalar layout and slices.
72
- let normalize = may_normalize
73
- && match op. layout . abi {
74
- layout:: Abi :: Scalar ( ..) => true ,
75
- layout:: Abi :: ScalarPair ( ..) => op. layout . ty . is_slice ( ) ,
76
- _ => false ,
77
- } ;
71
+ let normalize = match op. layout . abi {
72
+ layout:: Abi :: Scalar ( ..) => true ,
73
+ layout:: Abi :: ScalarPair ( ..) => op. layout . ty . is_slice ( ) ,
74
+ _ => false ,
75
+ } ;
78
76
let normalized_op = if normalize {
79
77
ecx. try_read_immediate ( op) ?
80
78
} else {
@@ -489,7 +487,7 @@ pub fn const_field<'a, 'tcx>(
489
487
let field = ecx. operand_field ( down, field. index ( ) as u64 ) ?;
490
488
// and finally move back to the const world, always normalizing because
491
489
// this is not called for statics.
492
- op_to_const ( & ecx, field, true )
490
+ op_to_const ( & ecx, field)
493
491
} ) ( ) ;
494
492
result. map_err ( |error| {
495
493
let err = error_to_const_error ( & ecx, error) ;
0 commit comments