Skip to content

Commit

Permalink
avoid computing Scalar size/align in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 11, 2022
1 parent 761077e commit 14f6daf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_const_eval/src/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
Expand Down

0 comments on commit 14f6daf

Please sign in to comment.