@@ -710,7 +710,7 @@ fn type_of_inner(@crate_ctxt cx, @ty.t t, bool boxed) -> TypeRef {
710
710
llty = T_fn_pair ( cx. tn , type_of_fn ( cx, proto, args, out, 0 u) ) ;
711
711
}
712
712
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
713
- auto nft = type_of_native_fn ( cx, abi , args , out , 0 u ) ;
713
+ auto nft = native_fn_wrapper_type ( cx, 0 u , t ) ;
714
714
llty = T_fn_pair ( cx. tn , nft) ;
715
715
}
716
716
case ( ty. ty_obj ( ?meths) ) {
@@ -6092,9 +6092,8 @@ fn native_fn_ty_param_count(@crate_ctxt cx, &ast.def_id id) -> uint {
6092
6092
ret count;
6093
6093
}
6094
6094
6095
- fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , & ast . ann ann )
6095
+ fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , @ty . t x )
6096
6096
-> TypeRef {
6097
- auto x = node_ann_type ( cx, ann) ;
6098
6097
alt ( x. struct ) {
6099
6098
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
6100
6099
ret type_of_fn ( cx, ast. proto_fn , args, out, ty_param_count) ;
@@ -6110,7 +6109,8 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
6110
6109
auto num_ty_param = native_fn_ty_param_count ( cx, id) ;
6111
6110
6112
6111
// Declare the wrapper.
6113
- auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, ann) ;
6112
+ auto t = node_ann_type ( cx, ann) ;
6113
+ auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, t) ;
6114
6114
let str s = mangle_name_by_seq ( cx, "wrapper" ) ;
6115
6115
let ValueRef wrapper_fn = decl_internal_fastcall_fn ( cx. llmod , s,
6116
6116
wrapper_type) ;
0 commit comments