+ _ if left.layout.ty.is_any_ptr() => {
+ // The RHS type must be the same *or an integer type* (for `Offset`).
+ assert!(
+ right.layout.ty == left.layout.ty || right.layout.ty.is_integral(),
+ "Unexpected types for BinOp: {:?} {:?} {:?}",
+ left.layout.ty, bin_op, right.layout.ty
+ );
+
+ M::binary_ptr_op(self, bin_op, left, right)
+ }
+ _ => bug!("Invalid MIR: bad LHS type for binop: {:?}", left.layout.ty),