Skip to content
Snippets Groups Projects
Commit 0872cdf7 authored by nilfit's avatar nilfit
Browse files

don't box built-in types

parent 9f07b0cc
Branches
No related tags found
No related merge requests found
...@@ -465,6 +465,10 @@ module MLToRust = struct ...@@ -465,6 +465,10 @@ module MLToRust = struct
def=def def=def
} }
let id_of_mlty t =
match t with
| Tapp (id, _) -> id
| _ -> raise (TODO "mlty is not Tapp")
let box_typedefs (itl: its_defn list) box_fields box_enum: Sid.t * Sbe.t = let box_typedefs (itl: its_defn list) box_fields box_enum: Sid.t * Sbe.t =
(* TODO box only fields that are necessary *) (* TODO box only fields that are necessary *)
...@@ -486,7 +490,11 @@ module MLToRust = struct ...@@ -486,7 +490,11 @@ module MLToRust = struct
(* in *) (* in *)
(* TODO see if something from itl is reachable through the ty *) (* TODO see if something from itl is reachable through the ty *)
let needs_box ty = true in let needs_box ty =
let id = id_of_mlty ty in
let is_ts ts = id_equal ts.ts_name id in
not (is_ts ts_int || is_ts ts_real || is_ts ts_bool)
in
let box its = let box its =
(match its.its_def with (match its.its_def with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment