@@ -7055,21 +7055,6 @@ fn arg_tys_of_fn(&@crate_ctxt ccx, ast::ann ann) -> vec[ty::arg] {
7055
7055
}
7056
7056
}
7057
7057
7058
- fn ret_ty_of_fn_ty( & @crate_ctxt ccx, ty:: t t) -> ty:: t {
7059
- alt ( ty:: struct ( ccx. tcx, t) ) {
7060
- case ( ty:: ty_fn( _, _, ?ret_ty, _, _) ) { ret ret_ty; }
7061
- case ( ty:: ty_native_fn( _, _, ?ret_ty) ) { ret ret_ty; }
7062
- case ( _) {
7063
- ccx. sess. bug( "ret_ty_of_fn_ty( ) called on non-function type : " +
7064
- ty_to_str( ccx. tcx, t) ) ;
7065
- }
7066
- }
7067
- }
7068
-
7069
- fn ret_ty_of_fn( & @crate_ctxt ccx, ast:: ann ann) -> ty:: t {
7070
- ret ret_ty_of_fn_ty( ccx, ty:: ann_to_type( ccx. tcx, ann) ) ;
7071
- }
7072
-
7073
7058
fn populate_fn_ctxt_from_llself( @fn_ctxt fcx, val_self_pair llself) {
7074
7059
auto bcx = llstaticallocas_block_ctxt( fcx) ;
7075
7060
let vec[ ty:: t] field_tys = [ ] ;
@@ -7143,8 +7128,8 @@ fn trans_fn(@local_ctxt cx, &span sp, &ast::_fn f, ValueRef llfndecl,
7143
7128
7144
7129
auto fcx = new_fn_ctxt( cx, sp, llfndecl) ;
7145
7130
create_llargs_for_fn_args( fcx, f. proto, ty_self,
7146
- ret_ty_of_fn( cx. ccx, ann) , f . decl . inputs ,
7147
- ty_params) ;
7131
+ ty :: ret_ty_of_fn( cx. ccx. tcx , ann) ,
7132
+ f . decl . inputs , ty_params) ;
7148
7133
copy_any_self_to_alloca( fcx, ty_self) ;
7149
7134
alt ( { fcx. llself } ) {
7150
7135
case ( some( ?llself) ) { populate_fn_ctxt_from_llself( fcx, llself) ; }
@@ -7275,7 +7260,8 @@ fn trans_obj(@local_ctxt cx, &span sp, &ast::_obj ob, ast::def_id oid,
7275
7260
// Both regular arguments and type parameters are handled here.
7276
7261
7277
7262
create_llargs_for_fn_args( fcx, ast:: proto_fn, none[ ty_self_pair] ,
7278
- ret_ty_of_fn( ccx, ann) , fn_args, ty_params) ;
7263
+ ty:: ret_ty_of_fn( ccx. tcx, ann) ,
7264
+ fn_args, ty_params) ;
7279
7265
let vec[ ty:: arg] arg_tys = arg_tys_of_fn( ccx, ann) ;
7280
7266
copy_args_to_allocas( fcx, fn_args, arg_tys) ;
7281
7267
// Create the first block context in the function and keep a handle on it
@@ -7286,7 +7272,7 @@ fn trans_obj(@local_ctxt cx, &span sp, &ast::_obj ob, ast::def_id oid,
7286
7272
// Pick up the type of this object by looking at our own output type, that
7287
7273
// is, the output type of the object constructor we're building.
7288
7274
7289
- auto self_ty = ret_ty_of_fn( ccx, ann) ;
7275
+ auto self_ty = ty :: ret_ty_of_fn( ccx. tcx , ann) ;
7290
7276
auto llself_ty = type_of( ccx, sp, self_ty) ;
7291
7277
// Set up the two-word pair that we're going to return from the object
7292
7278
// constructor we're building. The two elements of this pair will be a
@@ -7461,7 +7447,8 @@ fn trans_tag_variant(@local_ctxt cx, ast::def_id tag_id,
7461
7447
let ValueRef llfndecl = cx. ccx. item_ids. get( variant. node. id) ;
7462
7448
auto fcx = new_fn_ctxt( cx, variant. span, llfndecl) ;
7463
7449
create_llargs_for_fn_args( fcx, ast:: proto_fn, none[ ty_self_pair] ,
7464
- ret_ty_of_fn( cx. ccx, variant. node. ann) , fn_args,
7450
+ ty:: ret_ty_of_fn( cx. ccx. tcx, variant. node. ann) ,
7451
+ fn_args,
7465
7452
ty_params) ;
7466
7453
let vec[ ty:: t] ty_param_substs = [ ] ;
7467
7454
i = 0 u;
0 commit comments