Skip to content

Commit

Permalink
Support unions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Sep 5, 2024
1 parent 50d7bcd commit 3c706cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/exporter/src/types/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ impl<'tcx, S: UnderOwnerState<'tcx> + HasMir<'tcx>> SInto<S, Place>
ProjectionElem::Field(match cur_ty.kind() {
TyKind::Adt(adt_def, _) => {
assert!(
(adt_def.is_struct() && variant_idx.is_none())
((adt_def.is_struct() || adt_def.is_union())
&& variant_idx.is_none())
|| (adt_def.is_enum() && variant_idx.is_some())
);
ProjectionElemFieldKind::Adt {
Expand Down

0 comments on commit 3c706cb

Please sign in to comment.