@@ -705,7 +705,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t, bool boxed) -> TypeRef {
705
705
llty = T_fn_pair ( cx. tn , type_of_fn ( cx, proto, args, out, 0 u) ) ;
706
706
}
707
707
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
708
- auto nft = native_fn_wrapper_type ( cx, 0 u , t ) ;
708
+ auto nft = type_of_native_fn ( cx, abi , args , out , 0 u ) ;
709
709
llty = T_fn_pair ( cx. tn , nft) ;
710
710
}
711
711
case ( ty. ty_obj ( ?meths) ) {
@@ -1424,7 +1424,7 @@ fn trans_malloc_boxed(@block_ctxt cx, @ty.t t) -> result {
1424
1424
// Synthesize a fake box type structurally so we have something
1425
1425
// to measure the size of.
1426
1426
auto boxed_body = ty. plain_tup_ty( vec( plain_ty( ty. ty_int) , t) ) ;
1427
- auto box_ptr = ty. plain_box_ty( t) ;
1427
+ auto box_ptr = ty. plain_box_ty( t, ast . imm ) ;
1428
1428
auto sz = size_of( cx, boxed_body) ;
1429
1429
auto llty = type_of( cx. fcx. ccx, box_ptr) ;
1430
1430
ret trans_raw_malloc( sz. bcx, llty, sz. val) ;
@@ -2005,7 +2005,7 @@ fn iter_structural_ty_full(@block_ctxt cx,
2005
2005
auto box_a_ptr = cx. build. Load ( box_a_cell) ;
2006
2006
auto box_b_ptr = cx. build. Load ( box_b_cell) ;
2007
2007
auto tnil = plain_ty( ty. ty_nil) ;
2008
- auto tbox = ty. plain_box_ty( tnil) ;
2008
+ auto tbox = ty. plain_box_ty( tnil, ast . imm ) ;
2009
2009
2010
2010
auto inner_cx = new_sub_block_ctxt( cx, "iter box") ;
2011
2011
auto next_cx = new_sub_block_ctxt( cx, "next") ;
@@ -2557,7 +2557,7 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
2557
2557
ret res( sub. bcx, sub. bcx. build. Neg ( sub. val) ) ;
2558
2558
}
2559
2559
}
2560
- case ( ast. box) {
2560
+ case ( ast. box( _ ) ) {
2561
2561
auto e_ty = ty. expr_ty( e) ;
2562
2562
auto e_val = sub. val;
2563
2563
auto box_ty = node_ann_type( sub. bcx. fcx. ccx, a) ;
@@ -3943,7 +3943,7 @@ fn trans_bind_thunk(@crate_ctxt cx,
3943
3943
auto bcx = new_top_block_ctxt( fcx) ;
3944
3944
auto lltop = bcx. llbb;
3945
3945
3946
- auto llclosure_ptr_ty = type_of( cx, ty. plain_box_ty( closure_ty) ) ;
3946
+ auto llclosure_ptr_ty = type_of( cx, ty. plain_box_ty( closure_ty, ast . imm ) ) ;
3947
3947
auto llclosure = bcx. build. PointerCast ( fcx. llenv, llclosure_ptr_ty) ;
3948
3948
3949
3949
auto lltarget = GEP_tup_like ( bcx, closure_ty, llclosure,
@@ -5819,7 +5819,7 @@ fn trans_obj(@crate_ctxt cx, &ast._obj ob, ast.def_id oid,
5819
5819
let @ty. t body_ty = ty. plain_tup_ty( vec( tydesc_ty,
5820
5820
typarams_ty,
5821
5821
fields_ty) ) ;
5822
- let @ty. t boxed_body_ty = ty. plain_box_ty( body_ty) ;
5822
+ let @ty. t boxed_body_ty = ty. plain_box_ty( body_ty, ast . imm ) ;
5823
5823
5824
5824
// Malloc a box for the body.
5825
5825
auto box = trans_malloc_boxed( bcx, body_ty) ;
@@ -6101,8 +6101,9 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
6101
6101
ret count;
6102
6102
}
6103
6103
6104
- fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , @ty . t x )
6104
+ fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , & ast . ann ann )
6105
6105
-> TypeRef {
6106
+ auto x = node_ann_type ( cx, ann) ;
6106
6107
alt ( x. struct ) {
6107
6108
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
6108
6109
ret type_of_fn ( cx, ast. proto_fn , args, out, ty_param_count) ;
@@ -6118,8 +6119,7 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
6118
6119
auto num_ty_param = native_fn_ty_param_count ( cx, id) ;
6119
6120
6120
6121
// Declare the wrapper.
6121
- auto t = node_ann_type ( cx, ann) ;
6122
- auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, t) ;
6122
+ auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, ann) ;
6123
6123
let str s = mangle_name_by_seq ( cx, "wrapper" ) ;
6124
6124
let ValueRef wrapper_fn = decl_internal_fastcall_fn ( cx. llmod , s,
6125
6125
wrapper_type) ;
0 commit comments