Skip to content

Commit

Permalink
interpret: only consider 1-ZST when searching for receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 31, 2022
1 parent 4d6d601 commit 5798555
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_const_eval/src/interpret/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let mut non_zst_field = None;
for i in 0..receiver.layout.fields.count() {
let field = self.operand_field(&receiver, i)?;
if !field.layout.is_zst() {
let zst =
field.layout.is_zst() && field.layout.align.abi.bytes() == 1;
if !zst {
assert!(
non_zst_field.is_none(),
"multiple non-ZST fields in dyn receiver type {}",
Expand Down

0 comments on commit 5798555

Please sign in to comment.