@@ -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 = type_of_native_fn ( cx, abi , args , out , 0 u ) ;
708
+ auto nft = native_fn_wrapper_type ( cx, 0 u , t ) ;
709
709
llty = T_fn_pair ( cx. tn , nft) ;
710
710
}
711
711
case ( ty. ty_obj ( ?meths) ) {
@@ -6101,9 +6101,8 @@ 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 , & ast . ann ann )
6104
+ fn native_fn_wrapper_type ( @crate_ctxt cx , uint ty_param_count , @ty . t x )
6105
6105
-> TypeRef {
6106
- auto x = node_ann_type ( cx, ann) ;
6107
6106
alt ( x. struct ) {
6108
6107
case ( ty. ty_native_fn ( ?abi, ?args, ?out) ) {
6109
6108
ret type_of_fn ( cx, ast. proto_fn , args, out, ty_param_count) ;
@@ -6119,7 +6118,8 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
6119
6118
auto num_ty_param = native_fn_ty_param_count ( cx, id) ;
6120
6119
6121
6120
// Declare the wrapper.
6122
- auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, ann) ;
6121
+ auto t = node_ann_type ( cx, ann) ;
6122
+ auto wrapper_type = native_fn_wrapper_type ( cx, num_ty_param, t) ;
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