Skip to content

Commit b2ce3f8

Browse files
committed
share BinOp::Offset between CTFE and Miri
1 parent b9fe188 commit b2ce3f8

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/operator.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ impl<'mir, 'tcx> EvalContextExt<'tcx> for super::MiriInterpCx<'mir, 'tcx> {
5353
(Scalar::from_bool(res), false, self.tcx.types.bool)
5454
}
5555

56-
Offset => {
57-
assert!(left.layout.ty.is_unsafe_ptr());
58-
let ptr = left.to_scalar().to_pointer(self)?;
59-
let offset = right.to_scalar().to_target_isize(self)?;
60-
61-
let pointee_ty =
62-
left.layout.ty.builtin_deref(true).expect("Offset called on non-ptr type").ty;
63-
let ptr = self.ptr_offset_inbounds(ptr, pointee_ty, offset)?;
64-
(Scalar::from_maybe_pointer(ptr, self), false, left.layout.ty)
65-
}
66-
6756
// Some more operations are possible with atomics.
6857
// The return value always has the provenance of the *left* operand.
6958
Add | Sub | BitOr | BitAnd | BitXor => {

0 commit comments

Comments
 (0)