Skip to content

Commit

Permalink
fix(hax api): follow up PR for hacspec/hax#1057
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp authored and Nadrieril committed Oct 29, 2024
1 parent 029fa9b commit 3125a28
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions charon/src/bin/charon-driver/translate/translate_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,28 @@ impl<'tcx, 'ctx, 'ctx1> BodyTransCtx<'tcx, 'ctx, 'ctx1> {
let be = self.translate_constant_expr_to_constant_expr(span, be)?;
RawConstantExpr::Ref(Box::new(be))
}
ConstantExprKind::MutPtr(be) => {
let be = self.translate_constant_expr_to_constant_expr(span, be)?;
RawConstantExpr::MutPtr(Box::new(be))
ConstantExprKind::Cast { .. } => {
error_or_panic!(
self,
span,
&format!("Unsupported constant: `ConstantExprKind::Cast {{..}}`",)
)
}
ConstantExprKind::RawBorrow {
mutability: false, ..
} => {
error_or_panic!(
self,
span,
&format!("Unsupported constant: `ConstantExprKind::RawBorrow {{mutability: false, ..}}`",)
)
}
ConstantExprKind::RawBorrow {
mutability: true,
arg,
} => {
let arg = self.translate_constant_expr_to_constant_expr(span, arg)?;
RawConstantExpr::MutPtr(Box::new(arg))
}
ConstantExprKind::ConstRef { id } => {
let var_id = self.const_generic_vars_map.get(&id.index);
Expand Down

0 comments on commit 3125a28

Please sign in to comment.