summaryrefslogtreecommitdiff
path: root/src/Interpreter.ml
diff options
context:
space:
mode:
authorSon Ho2021-11-30 20:59:30 +0100
committerSon Ho2021-11-30 20:59:30 +0100
commit7963e3ee84090b96308eebc68ee20532ea85c532 (patch)
tree566ddf1e10b74d9cfa4111869369d9d1649e35fe /src/Interpreter.ml
parent4caa42db826999e4df74e2e3abf80f2b4c2650fa (diff)
Introduce [binder] and use them in place of [var] in the environments
Diffstat (limited to 'src/Interpreter.ml')
-rw-r--r--src/Interpreter.ml8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Interpreter.ml b/src/Interpreter.ml
index c2e44039..d737f79d 100644
--- a/src/Interpreter.ml
+++ b/src/Interpreter.ml
@@ -2059,15 +2059,13 @@ let eval_box_new (config : C.config) (region_params : T.erased_region list)
| ( [],
[ boxed_ty ],
Var (input_var, input_value) :: Var (_ret_var, _) :: C.Frame :: _ ) ->
- (* Sanity check for invariant *)
- assert (input_var.var_ty = input_value.V.ty);
(* Required type checking *)
assert (input_value.V.ty = boxed_ty);
(* Move the input value *)
let ctx, moved_input_value =
eval_operand config ctx
- (E.Move (mk_place_from_var_id input_var.V.index))
+ (E.Move (mk_place_from_var_id input_var.C.index))
in
(* Create the box value *)
@@ -2107,8 +2105,6 @@ let eval_box_deref_mut_or_shared (config : C.config)
| ( [],
[ boxed_ty ],
Var (input_var, input_value) :: Var (_ret_var, _) :: C.Frame :: _ ) -> (
- (* Sanity check for invariant *)
- assert (input_var.var_ty = input_value.V.ty);
(* Required type checking. We must have:
- input_value.ty == & (mut) Box<ty>
- boxed_ty == ty
@@ -2121,7 +2117,7 @@ let eval_box_deref_mut_or_shared (config : C.config)
(* Borrow the boxed value *)
let p =
- { E.var_id = input_var.V.index; projection = [ E.Deref; E.DerefBox ] }
+ { E.var_id = input_var.C.index; projection = [ E.Deref; E.DerefBox ] }
in
let borrow_kind = if is_mut then E.Mut else E.Shared in
let rv = E.Ref (p, borrow_kind) in