Remove NullOp::Box
This commit is contained in:
parent
6162529a01
commit
1b7f5a3818
11 changed files with 2 additions and 92 deletions
|
@ -267,10 +267,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
self.write_immediate(place.to_ref(self), &dest)?;
|
||||
}
|
||||
|
||||
NullaryOp(mir::NullOp::Box, _) => {
|
||||
M::box_alloc(self, &dest)?;
|
||||
}
|
||||
|
||||
NullaryOp(null_op, ty) => {
|
||||
let ty = self.subst_from_current_frame_and_normalize_erasing_regions(ty);
|
||||
let layout = self.layout_of(ty)?;
|
||||
|
@ -285,7 +281,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
let val = match null_op {
|
||||
mir::NullOp::SizeOf => layout.size.bytes(),
|
||||
mir::NullOp::AlignOf => layout.align.abi.bytes(),
|
||||
mir::NullOp::Box => unreachable!(),
|
||||
};
|
||||
self.write_scalar(Scalar::from_machine_usize(val, self), &dest)?;
|
||||
}
|
||||
|
|
|
@ -680,7 +680,6 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
|
|||
}
|
||||
|
||||
Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, _) => {}
|
||||
Rvalue::NullaryOp(NullOp::Box, _) => self.check_op(ops::HeapAllocation),
|
||||
Rvalue::ShallowInitBox(_, _) => {}
|
||||
|
||||
Rvalue::UnaryOp(_, ref operand) => {
|
||||
|
|
|
@ -517,7 +517,6 @@ impl<'tcx> Validator<'_, 'tcx> {
|
|||
}
|
||||
|
||||
Rvalue::NullaryOp(op, _) => match op {
|
||||
NullOp::Box => return Err(Unpromotable),
|
||||
NullOp::SizeOf => {}
|
||||
NullOp::AlignOf => {}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue