@@ -78,7 +78,7 @@ use typeck::infer::{resolve_type, force_tvar};
78
78
use result:: { Result , Ok , Err } ;
79
79
use syntax:: print:: pprust;
80
80
use syntax:: parse:: token:: special_idents;
81
- use vtable:: LocationInfo ;
81
+ use vtable:: { LocationInfo , VtableContext } ;
82
82
83
83
use std:: map:: HashMap ;
84
84
@@ -865,20 +865,20 @@ fn check_expr(fcx: @fn_ctxt, expr: @ast::expr,
865
865
// declared on the impl declaration e.g., `impl<A,B> for ~[(A,B)]`
866
866
// would return ($0, $1) where $0 and $1 are freshly instantiated type
867
867
// variables.
868
- fn impl_self_ty( fcx : @ fn_ctxt ,
868
+ fn impl_self_ty( vcx : & VtableContext ,
869
869
location_info : & LocationInfo , // (potential) receiver for
870
870
// this impl
871
871
did : ast:: def_id ) -> ty_param_substs_and_ty {
872
- let tcx = fcx . ccx . tcx ;
872
+ let tcx = vcx . tcx ( ) ;
873
873
874
874
let { n_tps, region_param, raw_ty} = if did. crate == ast:: local_crate {
875
- let region_param = fcx . tcx ( ) . region_paramd_items . find ( did. node ) ;
875
+ let region_param = tcx. region_paramd_items . find ( did. node ) ;
876
876
match tcx. items . find ( did. node ) {
877
877
Some ( ast_map:: node_item( @{ node : ast:: item_impl( ts, _, st, _) ,
878
878
_} , _) ) => {
879
879
{ n_tps: ts. len ( ) ,
880
880
region_param: region_param,
881
- raw_ty: fcx . ccx . to_ty ( rscope:: type_rscope ( region_param) , st) }
881
+ raw_ty: vcx . ccx . to_ty ( rscope:: type_rscope ( region_param) , st) }
882
882
}
883
883
Some ( ast_map:: node_item( @{ node : ast:: item_class( _, ts) ,
884
884
id : class_id, _} , _) ) => {
@@ -904,12 +904,12 @@ fn impl_self_ty(fcx: @fn_ctxt,
904
904
} ;
905
905
906
906
let self_r = if region_param. is_some ( ) {
907
- Some ( fcx . infcx ( ) . next_region_var ( location_info. span ,
907
+ Some ( vcx . infcx . next_region_var ( location_info. span ,
908
908
location_info. id ) )
909
909
} else {
910
910
None
911
911
} ;
912
- let tps = fcx . infcx ( ) . next_ty_vars ( n_tps) ;
912
+ let tps = vcx . infcx . next_ty_vars ( n_tps) ;
913
913
914
914
let substs = { self_r: self_r, self_ty: None , tps: tps} ;
915
915
let substd_ty = ty:: subst ( tcx, & substs, raw_ty) ;
0 commit comments