@@ -39,7 +39,7 @@ use middle::astencode;
3939use middle:: lang_items:: { LangItem , ExchangeMallocFnLangItem , StartFnLangItem } ;
4040use middle:: subst;
4141use middle:: weak_lang_items;
42- use middle:: subst:: Subst ;
42+ use middle:: subst:: { Subst , Substs } ;
4343use middle:: trans:: _match;
4444use middle:: trans:: adt;
4545use middle:: trans:: build:: * ;
@@ -51,8 +51,8 @@ use middle::trans::cleanup;
5151use middle:: trans:: common:: { Block , C_bool , C_bytes_in_context , C_i32 , C_integral , C_nil } ;
5252use middle:: trans:: common:: { C_null , C_struct_in_context , C_u64 , C_u8 , C_uint , C_undef } ;
5353use middle:: trans:: common:: { CrateContext , ExternMap , FunctionContext } ;
54- use middle:: trans:: common:: { NodeInfo , Result , SubstP } ;
55- use middle:: trans:: common:: { node_id_type, param_substs , return_type_is_void} ;
54+ use middle:: trans:: common:: { NodeInfo , Result } ;
55+ use middle:: trans:: common:: { node_id_type, return_type_is_void} ;
5656use middle:: trans:: common:: { tydesc_info, type_is_immediate} ;
5757use middle:: trans:: common:: { type_is_zero_size, val_ty} ;
5858use middle:: trans:: common;
@@ -1431,11 +1431,11 @@ pub fn new_fn_ctxt<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
14311431 id : ast:: NodeId ,
14321432 has_env : bool ,
14331433 output_type : ty:: FnOutput < ' tcx > ,
1434- param_substs : & ' a param_substs < ' tcx > ,
1434+ param_substs : & ' a Substs < ' tcx > ,
14351435 sp : Option < Span > ,
14361436 block_arena : & ' a TypedArena < common:: BlockS < ' a , ' tcx > > )
14371437 -> FunctionContext < ' a , ' tcx > {
1438- param_substs . validate ( ) ;
1438+ common :: validate_substs ( param_substs ) ;
14391439
14401440 debug ! ( "new_fn_ctxt(path={}, id={}, param_substs={})" ,
14411441 if id == -1 {
@@ -1447,7 +1447,7 @@ pub fn new_fn_ctxt<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
14471447
14481448 let uses_outptr = match output_type {
14491449 ty:: FnConverging ( output_type) => {
1450- let substd_output_type = output_type. substp ( ccx. tcx ( ) , param_substs) ;
1450+ let substd_output_type = output_type. subst ( ccx. tcx ( ) , param_substs) ;
14511451 type_of:: return_uses_outptr ( ccx, substd_output_type)
14521452 }
14531453 ty:: FnDiverging => false
@@ -1500,7 +1500,7 @@ pub fn init_function<'a, 'tcx>(fcx: &'a FunctionContext<'a, 'tcx>,
15001500 if let ty:: FnConverging ( output_type) = output {
15011501 // This shouldn't need to recompute the return type,
15021502 // as new_fn_ctxt did it already.
1503- let substd_output_type = output_type. substp ( fcx. ccx . tcx ( ) , fcx. param_substs ) ;
1503+ let substd_output_type = output_type. subst ( fcx. ccx . tcx ( ) , fcx. param_substs ) ;
15041504 if !return_type_is_void ( fcx. ccx , substd_output_type) {
15051505 // If the function returns nil/bot, there is no real return
15061506 // value, so do not set `llretslotptr`.
@@ -1729,7 +1729,7 @@ pub fn finish_fn<'blk, 'tcx>(fcx: &'blk FunctionContext<'blk, 'tcx>,
17291729
17301730 // This shouldn't need to recompute the return type,
17311731 // as new_fn_ctxt did it already.
1732- let substd_retty = retty. substp ( fcx. ccx . tcx ( ) , fcx. param_substs ) ;
1732+ let substd_retty = retty. subst ( fcx. ccx . tcx ( ) , fcx. param_substs ) ;
17331733 build_return_block ( fcx, ret_cx, substd_retty) ;
17341734
17351735 debuginfo:: clear_source_location ( fcx) ;
@@ -1805,7 +1805,7 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
18051805 decl : & ast:: FnDecl ,
18061806 body : & ast:: Block ,
18071807 llfndecl : ValueRef ,
1808- param_substs : & param_substs < ' tcx > ,
1808+ param_substs : & Substs < ' tcx > ,
18091809 fn_ast_id : ast:: NodeId ,
18101810 _attributes : & [ ast:: Attribute ] ,
18111811 output_type : ty:: FnOutput < ' tcx > ,
@@ -1950,7 +1950,7 @@ pub fn trans_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
19501950 decl : & ast:: FnDecl ,
19511951 body : & ast:: Block ,
19521952 llfndecl : ValueRef ,
1953- param_substs : & param_substs < ' tcx > ,
1953+ param_substs : & Substs < ' tcx > ,
19541954 id : ast:: NodeId ,
19551955 attrs : & [ ast:: Attribute ] ) {
19561956 let _s = StatRecorder :: new ( ccx, ccx. tcx ( ) . map . path_to_string ( id) . to_string ( ) ) ;
@@ -1976,7 +1976,7 @@ pub fn trans_enum_variant<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
19761976 variant : & ast:: Variant ,
19771977 _args : & [ ast:: VariantArg ] ,
19781978 disr : ty:: Disr ,
1979- param_substs : & param_substs < ' tcx > ,
1979+ param_substs : & Substs < ' tcx > ,
19801980 llfndecl : ValueRef ) {
19811981 let _icx = push_ctxt ( "trans_enum_variant" ) ;
19821982
@@ -2051,7 +2051,7 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
20512051pub fn trans_tuple_struct < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
20522052 _fields : & [ ast:: StructField ] ,
20532053 ctor_id : ast:: NodeId ,
2054- param_substs : & param_substs < ' tcx > ,
2054+ param_substs : & Substs < ' tcx > ,
20552055 llfndecl : ValueRef ) {
20562056 let _icx = push_ctxt ( "trans_tuple_struct" ) ;
20572057
@@ -2066,10 +2066,10 @@ pub fn trans_tuple_struct<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
20662066fn trans_enum_variant_or_tuple_like_struct < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
20672067 ctor_id : ast:: NodeId ,
20682068 disr : ty:: Disr ,
2069- param_substs : & param_substs < ' tcx > ,
2069+ param_substs : & Substs < ' tcx > ,
20702070 llfndecl : ValueRef ) {
20712071 let ctor_ty = ty:: node_id_to_type ( ccx. tcx ( ) , ctor_id) ;
2072- let ctor_ty = ctor_ty. substp ( ccx. tcx ( ) , param_substs) ;
2072+ let ctor_ty = ctor_ty. subst ( ccx. tcx ( ) , param_substs) ;
20732073
20742074 let result_ty = match ty:: get ( ctor_ty) . sty {
20752075 ty:: ty_bare_fn( ref bft) => bft. sig . output ,
@@ -2242,15 +2242,15 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
22422242 & * * body,
22432243 item. attrs . as_slice ( ) ,
22442244 llfn,
2245- & param_substs :: empty ( ) ,
2245+ & Substs :: trans_empty ( ) ,
22462246 item. id ,
22472247 None ) ;
22482248 } else {
22492249 trans_fn ( ccx,
22502250 & * * decl,
22512251 & * * body,
22522252 llfn,
2253- & param_substs :: empty ( ) ,
2253+ & Substs :: trans_empty ( ) ,
22542254 item. id ,
22552255 item. attrs . as_slice ( ) ) ;
22562256 }
0 commit comments