From 4e4de3f5b771cac99593f2421a122a7bc6e06ffb Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 3 Apr 2024 21:30:19 +0900 Subject: [PATCH] Fix ICE on unchecked shift --- src/num.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/num.rs b/src/num.rs index 8992f40fb90..fd665d5932f 100644 --- a/src/num.rs +++ b/src/num.rs @@ -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,