File tree 1 file changed +5
-10
lines changed 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>(
68
68
op : OpTy < ' tcx > ,
69
69
) -> EvalResult < ' tcx , ty:: Const < ' tcx > > {
70
70
// 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 {
80
75
Operand :: Indirect ( mplace) => Err ( mplace) ,
81
76
Operand :: Immediate ( val) => Ok ( val)
82
- }
77
+ } ,
83
78
} ;
84
79
let ( val, alloc) = match normalized_op {
85
80
Err ( MemPlace { ptr, align, meta } ) => {
You can’t perform that action at this time.
0 commit comments