Skip to content

Commit 5798555

Browse files
committed
interpret: only consider 1-ZST when searching for receiver
1 parent 4d6d601 commit 5798555

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_const_eval/src/interpret/terminator.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
534534
let mut non_zst_field = None;
535535
for i in 0..receiver.layout.fields.count() {
536536
let field = self.operand_field(&receiver, i)?;
537-
if !field.layout.is_zst() {
537+
let zst =
538+
field.layout.is_zst() && field.layout.align.abi.bytes() == 1;
539+
if !zst {
538540
assert!(
539541
non_zst_field.is_none(),
540542
"multiple non-ZST fields in dyn receiver type {}",

0 commit comments

Comments
 (0)