Fix crasher in rustc.
This commit is contained in:
parent
668f3a90a8
commit
f234750d80
4 changed files with 14 additions and 5 deletions
|
@ -465,6 +465,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
|
||||||
destructor-ordering.rs \
|
destructor-ordering.rs \
|
||||||
drop-bind-thunk-args.rs \
|
drop-bind-thunk-args.rs \
|
||||||
drop-on-empty-block-exit.rs \
|
drop-on-empty-block-exit.rs \
|
||||||
|
drop-parametric-closure-with-bound-box.rs \
|
||||||
export-non-interference.rs \
|
export-non-interference.rs \
|
||||||
exterior.rs \
|
exterior.rs \
|
||||||
fn-lval.rs \
|
fn-lval.rs \
|
||||||
|
|
|
@ -62,10 +62,12 @@ let obj_body_elt_fields = 1;;
|
||||||
let fn_field_code = binding_field_dispatch;;
|
let fn_field_code = binding_field_dispatch;;
|
||||||
let fn_field_box = binding_field_bound_data;;
|
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_bound_args_tydesc = 0;;
|
||||||
let closure_body_elt_target = 1;;
|
let closure_body_elt_target = 1;;
|
||||||
let closure_body_elt_bound_ty_params = 2;;
|
let closure_body_elt_bound_args = 2;;
|
||||||
let closure_body_elt_bound_args = 3;;
|
let closure_body_elt_bound_ty_params = 3;;
|
||||||
|
|
||||||
let tag_elt_discriminant = 0;;
|
let tag_elt_discriminant = 0;;
|
||||||
let tag_elt_variant = 1;;
|
let tag_elt_variant = 1;;
|
||||||
|
|
|
@ -2219,9 +2219,10 @@ let rec closure_box_rty
|
||||||
r (Array.init n_ty_params (fun _ -> tydesc))
|
r (Array.init n_ty_params (fun _ -> tydesc))
|
||||||
in
|
in
|
||||||
let bound_args = r (Array.map (slot_referent_type cx) bs) 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
|
(* First tydesc is the one describing bound_args; second tydesc cluster
|
||||||
* to pass to targ when invoking it. *)
|
* are those to pass to targ when invoking it, along with the merged
|
||||||
r [| rc; r [| tydesc; targ; ty_param_rtys; bound_args |] |]
|
* bound args. *)
|
||||||
|
r [| rc; r [| tydesc; targ; bound_args; ty_param_rtys |] |]
|
||||||
|
|
||||||
and fn_rty (cx:ctxt) (opaque_box_body:bool) : Il.referent_ty =
|
and fn_rty (cx:ctxt) (opaque_box_body:bool) : Il.referent_ty =
|
||||||
let s t = Il.ScalarTy t in
|
let s t = Il.ScalarTy t in
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
fn f[T](@int i, T t) {}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
auto x = bind f[char](@0xdeafbeef, _);
|
||||||
|
}
|
Loading…
Reference in a new issue