Merge pull request #1476 from taiki-e/unchecked-shift

Fix ICE on unchecked shift
This commit is contained in:
bjorn3 2024-04-03 19:54:56 +02:00 committed by GitHub
commit 64d6da5cda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,7 +110,7 @@ pub(crate) fn codegen_int_binop<'tcx>(
in_lhs: CValue<'tcx>,
in_rhs: CValue<'tcx>,
) -> CValue<'tcx> {
if bin_op != BinOp::Shl && bin_op != BinOp::Shr {
if !matches!(bin_op, BinOp::Shl | BinOp::ShlUnchecked | BinOp::Shr | BinOp::ShrUnchecked) {
assert_eq!(
in_lhs.layout().ty,
in_rhs.layout().ty,