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 committed Oct 28, 2024
1 parent 029fa9b commit 354b13d
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: true, ..
} => {
error_or_panic!(
self,
span,
&format!("Unsupported constant: `ConstantExprKind::RawBorrow {{mutability: true, ..}}`",)
)
}
ConstantExprKind::RawBorrow {
mutability: false,
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 354b13d

Please sign in to comment.