From 14f6daf9359c920da3da6ccce41fa910dc2074a3 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 11 May 2022 13:32:19 +0200 Subject: [PATCH] avoid computing Scalar size/align in debug builds --- compiler/rustc_const_eval/src/interpret/operand.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index 62a95fa57cfa9..b18948ce926c0 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -418,11 +418,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { (Immediate::ScalarPair(a_val, b_val), Abi::ScalarPair(a, b)) => { assert!(matches!(field_layout.abi, Abi::Scalar(..))); Immediate::from(if offset.bytes() == 0 { - assert_eq!(field_layout.size, a.size(self)); + debug_assert_eq!(field_layout.size, a.size(self)); a_val } else { - assert_eq!(offset, a.size(self).align_to(b.align(self).abi)); - assert_eq!(field_layout.size, b.size(self)); + debug_assert_eq!(offset, a.size(self).align_to(b.align(self).abi)); + debug_assert_eq!(field_layout.size, b.size(self)); b_val }) }