diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index 919eaca90ce..d9a390184d9 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -137,7 +137,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } Assert { ref cond, expected, ref msg, target, cleanup } => { - let ignored = !self.tcx.sess.overflow_checks() + let ignored = M::checked_binop_checks_overflow(self) && match msg { mir::AssertKind::OverflowNeg(..) => true, mir::AssertKind::Overflow(op, ..) => op.is_checkable(),