Skip to content

Commit 01948e2

Browse files
committed
Looser check for binary_op_overflow
1 parent 4a7fb97 commit 01948e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_const_eval/src/interpret/operator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
330330
_ if left.layout.ty.is_any_ptr() => {
331331
// The RHS type must be the same *or an integer type* (for `Offset`).
332332
assert!(
333-
right.layout.ty == left.layout.ty || right.layout.ty.is_integral(),
333+
right.layout.ty.is_any_ptr()|| right.layout.ty.is_integral(),
334334
"Unexpected types for BinOp: {:?} {:?} {:?}",
335335
left.layout.ty,
336336
bin_op,

0 commit comments

Comments
 (0)