interpret: refactor projection code to work on a common trait, and use that for visitors
This commit is contained in:
@@ -425,11 +425,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
);
|
||||
|
||||
for i in 0..dest_len {
|
||||
let place = self.mplace_index(&dest, i)?;
|
||||
let place = self.project_index(&dest, i)?;
|
||||
let value = if i == index {
|
||||
elem.clone()
|
||||
} else {
|
||||
self.mplace_index(&input, i)?.into()
|
||||
self.project_index(&input, i)?.into()
|
||||
};
|
||||
self.copy_op(&value, &place.into(), /*allow_transmute*/ false)?;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
input_len
|
||||
);
|
||||
self.copy_op(
|
||||
&self.mplace_index(&input, index)?.into(),
|
||||
&self.project_index(&input, index)?.into(),
|
||||
dest,
|
||||
/*allow_transmute*/ false,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user