Skip to content

Commit 14f6daf

Browse files
committed
avoid computing Scalar size/align in debug builds
1 parent 761077e commit 14f6daf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_const_eval/src/interpret/operand.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
418418
(Immediate::ScalarPair(a_val, b_val), Abi::ScalarPair(a, b)) => {
419419
assert!(matches!(field_layout.abi, Abi::Scalar(..)));
420420
Immediate::from(if offset.bytes() == 0 {
421-
assert_eq!(field_layout.size, a.size(self));
421+
debug_assert_eq!(field_layout.size, a.size(self));
422422
a_val
423423
} else {
424-
assert_eq!(offset, a.size(self).align_to(b.align(self).abi));
425-
assert_eq!(field_layout.size, b.size(self));
424+
debug_assert_eq!(offset, a.size(self).align_to(b.align(self).abi));
425+
debug_assert_eq!(field_layout.size, b.size(self));
426426
b_val
427427
})
428428
}

0 commit comments

Comments
 (0)