File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -68,18 +68,13 @@ fn op_to_const<'tcx>(
6868 op : OpTy < ' tcx > ,
6969) -> EvalResult < ' tcx , ty:: Const < ' tcx > > {
7070 // We do not normalize just any data. Only scalar layout and slices.
71- let normalize = match op. layout . abi {
72- layout:: Abi :: Scalar ( ..) => true ,
73- layout:: Abi :: ScalarPair ( ..) => op. layout . ty . is_slice ( ) ,
74- _ => false ,
75- } ;
76- let normalized_op = if normalize {
77- ecx. try_read_immediate ( op) ?
78- } else {
79- match * op {
71+ let normalized_op = match op. layout . abi {
72+ layout:: Abi :: Scalar ( ..) => ecx. try_read_immediate ( op) ?,
73+ layout:: Abi :: ScalarPair ( ..) if op. layout . ty . is_slice ( ) => ecx. try_read_immediate ( op) ?,
74+ _ => match * op {
8075 Operand :: Indirect ( mplace) => Err ( mplace) ,
8176 Operand :: Immediate ( val) => Ok ( val)
82- }
77+ } ,
8378 } ;
8479 let ( val, alloc) = match normalized_op {
8580 Err ( MemPlace { ptr, align, meta } ) => {
You can’t perform that action at this time.
0 commit comments