Skip to content

Commit 81c453d

Browse files
committed
Permit ImmTy::_offset to equally-sized aggreate fields if they are uninhabited
1 parent eea05d4 commit 81c453d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
279279
match (self.layout.abi, layout.abi) {
280280
(Abi::Scalar(..), Abi::Scalar(..)) => true,
281281
(Abi::ScalarPair(..), Abi::ScalarPair(..)) => true,
282-
_ => false,
282+
_ => layout.abi == Abi::Uninhabited,
283283
},
284284
"cannot project into {} immediate with equally-sized field {}\nouter ABI: {:#?}\nfield ABI: {:#?}",
285285
self.layout.ty,

0 commit comments

Comments
 (0)