aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me/semant.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-10-10 00:14:26 -0700
committerGraydon Hoare <[email protected]>2010-10-10 00:14:26 -0700
commitcaaf8679d8d22d75511fb0fc2adef585990ef397 (patch)
tree4d453d134514ffb2393eb7e7331c59b357a2f3e8 /src/boot/me/semant.ml
parentSubject copying code to inline heuristic, cut 30kb from rustc. (diff)
downloadrust-caaf8679d8d22d75511fb0fc2adef585990ef397.tar.xz
rust-caaf8679d8d22d75511fb0fc2adef585990ef397.zip
Teach bind to actually bind typarams, as it claims to.
Diffstat (limited to 'src/boot/me/semant.ml')
-rw-r--r--src/boot/me/semant.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml
index ee3b9aba..15105ab3 100644
--- a/src/boot/me/semant.ml
+++ b/src/boot/me/semant.ml
@@ -2190,7 +2190,11 @@ let obj_rty (word_bits:Il.bits) : Il.referent_ty =
r [| obj_vtbl_ptr; obj_box_ptr |]
;;
-let rec closure_box_rty (cx:ctxt) (bs:Ast.slot array) : Il.referent_ty =
+let rec closure_box_rty
+ (cx:ctxt)
+ (n_ty_params:int)
+ (bs:Ast.slot array)
+ : Il.referent_ty =
let s t = Il.ScalarTy t in
let p t = Il.AddrTy t in
let sp t = s (p t) in
@@ -2200,10 +2204,13 @@ let rec closure_box_rty (cx:ctxt) (bs:Ast.slot array) : Il.referent_ty =
let rc = word_rty word_bits in
let tydesc = sp (tydesc_rty word_bits) in
let targ = fn_rty cx true in
+ let ty_param_rtys =
+ r (Array.init n_ty_params (fun _ -> tydesc))
+ in
let bound_args = r (Array.map (slot_referent_type cx) bs) in
(* First tydesc is the one describing bound_args; second tydesc is the one
* to pass to targ when invoking it. *)
- r [| rc; r [| tydesc; tydesc; targ; bound_args |] |]
+ r [| rc; r [| tydesc; targ; ty_param_rtys; bound_args |] |]
and fn_rty (cx:ctxt) (opaque_box_body:bool) : Il.referent_ty =
let s t = Il.ScalarTy t in
@@ -2216,7 +2223,7 @@ and fn_rty (cx:ctxt) (opaque_box_body:bool) : Il.referent_ty =
let box =
if opaque_box_body
then r [| word; Il.OpaqueTy |]
- else closure_box_rty cx [||]
+ else closure_box_rty cx 0 [||]
in
let box_ptr = sp box in
let code_ptr = sp Il.CodeTy in