From 01948e2f45acefc336501b9b9f836845fc566774 Mon Sep 17 00:00:00 2001 From: ouz-a Date: Mon, 13 Dec 2021 12:35:55 +0300 Subject: [PATCH] Looser check for binary_op_overflow --- compiler/rustc_const_eval/src/interpret/operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs index a90582fc3382..a3094c8991c7 100644 --- a/compiler/rustc_const_eval/src/interpret/operator.rs +++ b/compiler/rustc_const_eval/src/interpret/operator.rs @@ -330,7 +330,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { _ 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(), + right.layout.ty.is_any_ptr()|| right.layout.ty.is_integral(), "Unexpected types for BinOp: {:?} {:?} {:?}", left.layout.ty, bin_op,