diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index b39b219b46a1..ca0f40639664 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -279,7 +279,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> { match (self.layout.abi, layout.abi) { (Abi::Scalar(..), Abi::Scalar(..)) => true, (Abi::ScalarPair(..), Abi::ScalarPair(..)) => true, - _ => false, + _ => layout.abi == Abi::Uninhabited, }, "cannot project into {} immediate with equally-sized field {}\nouter ABI: {:#?}\nfield ABI: {:#?}", self.layout.ty,