Fix crasher in rustc.

This commit is contained in:
Graydon Hoare 2010-10-14 12:41:48 -07:00
parent 668f3a90a8
commit f234750d80
4 changed files with 14 additions and 5 deletions

View file

@ -465,6 +465,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
destructor-ordering.rs \
drop-bind-thunk-args.rs \
drop-on-empty-block-exit.rs \
drop-parametric-closure-with-bound-box.rs \
export-non-interference.rs \
exterior.rs \
fn-lval.rs \

View file

@ -62,10 +62,12 @@ let obj_body_elt_fields = 1;;
let fn_field_code = binding_field_dispatch;;
let fn_field_box = binding_field_bound_data;;
(* NB: bound ty params come last to facilitate ignoring them on
* closure-dropping. *)
let closure_body_elt_bound_args_tydesc = 0;;
let closure_body_elt_target = 1;;
let closure_body_elt_bound_ty_params = 2;;
let closure_body_elt_bound_args = 3;;
let closure_body_elt_bound_args = 2;;
let closure_body_elt_bound_ty_params = 3;;
let tag_elt_discriminant = 0;;
let tag_elt_variant = 1;;

View file

@ -2219,9 +2219,10 @@ let rec closure_box_rty
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; targ; ty_param_rtys; bound_args |] |]
(* First tydesc is the one describing bound_args; second tydesc cluster
* are those to pass to targ when invoking it, along with the merged
* bound args. *)
r [| rc; r [| tydesc; targ; bound_args; ty_param_rtys |] |]
and fn_rty (cx:ctxt) (opaque_box_body:bool) : Il.referent_ty =
let s t = Il.ScalarTy t in

View file

@ -0,0 +1,5 @@
fn f[T](@int i, T t) {}
fn main() {
auto x = bind f[char](@0xdeafbeef, _);
}