From 7f36a3fcd788292c56c3a21e6145e7f6c78f0d84 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 11 Feb 2023 17:07:36 +0000 Subject: [PATCH] Fix CTFE interpreter. --- compiler/rustc_const_eval/src/interpret/terminator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(),