about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-05-11 13:32:19 +0200
committerRalf Jung <post@ralfj.de>2022-05-11 13:32:19 +0200
commit14f6daf9359c920da3da6ccce41fa910dc2074a3 (patch)
tree2869b7be47116edba33f924357eac1343ad73b9d /compiler/rustc_const_eval/src/interpret
parent761077e19e4f59e4e68f39ec875b3f3799bf8a4f (diff)
downloadrust-14f6daf9359c920da3da6ccce41fa910dc2074a3.tar.gz
rust-14f6daf9359c920da3da6ccce41fa910dc2074a3.zip
avoid computing Scalar size/align in debug builds
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs6
1 files 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 62a95fa57cf..b18948ce926 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
                 })
             }