From 9e4e8054882de9e0f9496e415eecd5205a52f0e7 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 11 May 2024 17:06:43 +0000 Subject: [PATCH] Avoid ICE on transmuting invalid bools Fixes rust-lang/rustc_codegen_cranelift#1433 --- src/value_and_place.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/value_and_place.rs b/src/value_and_place.rs index a11abd0c0e9..b6d6d211e65 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -317,14 +317,6 @@ impl<'tcx> CValue<'tcx> { let clif_ty = fx.clif_type(layout.ty).unwrap(); - if let ty::Bool = layout.ty.kind() { - assert!( - const_val == ty::ScalarInt::FALSE || const_val == ty::ScalarInt::TRUE, - "Invalid bool 0x{:032X}", - const_val - ); - } - let val = match layout.ty.kind() { ty::Uint(UintTy::U128) | ty::Int(IntTy::I128) => { let const_val = const_val.assert_bits(layout.size);