Skip to content

Commit

Permalink
fix(hax): VariantInformations has now a kind field, use that
Browse files Browse the repository at this point in the history
Companion PR for hacspec/hax#999.
  • Loading branch information
W95Psp committed Oct 14, 2024
1 parent a23a38b commit c71e0eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions charon/src/bin/charon-driver/translate/translate_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ impl<'tcx, 'ctx, 'ctx1> BodyTransCtx<'tcx, 'ctx, 'ctx1> {
// TODO: the user_ty is not always None
.map(|f| self.translate_constant_expr_to_constant_expr(span, &f.value))
.try_collect()?;
let vid = if info.typ_is_struct {
None
use hax::VariantKind;
let vid = if let VariantKind::Enum { index, .. } = info.kind {
Some(VariantId::new(index))
} else {
Some(VariantId::new(info.variant_index))
None
};
RawConstantExpr::Adt(vid, fields)
}
Expand Down

0 comments on commit c71e0eb

Please sign in to comment.