@@ -66,15 +66,13 @@ pub(crate) fn eval_promoted<'a, 'mir, 'tcx>(
6666pub fn op_to_const < ' tcx > (
6767 ecx : & CompileTimeEvalContext < ' _ , ' _ , ' tcx > ,
6868 op : OpTy < ' tcx > ,
69- may_normalize : bool ,
7069) -> EvalResult < ' tcx , ty:: Const < ' tcx > > {
7170 // 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+ } ;
7876 let normalized_op = if normalize {
7977 ecx. try_read_immediate ( op) ?
8078 } else {
@@ -489,7 +487,7 @@ pub fn const_field<'a, 'tcx>(
489487 let field = ecx. operand_field ( down, field. index ( ) as u64 ) ?;
490488 // and finally move back to the const world, always normalizing because
491489 // this is not called for statics.
492- op_to_const ( & ecx, field, true )
490+ op_to_const ( & ecx, field)
493491 } ) ( ) ;
494492 result. map_err ( |error| {
495493 let err = error_to_const_error ( & ecx, error) ;
0 commit comments