@@ -1209,9 +1209,7 @@ impl<'tcx> TraitRef<'tcx> {
12091209/// future I hope to refine the representation of types so as to make
12101210/// more distinctions clearer.
12111211#[ derive( Clone ) ]
1212- pub struct ParameterEnvironment < ' a , ' tcx : ' a > {
1213- pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1214-
1212+ pub struct ParameterEnvironment < ' tcx > {
12151213 /// See `construct_free_substs` for details.
12161214 pub free_substs : Substs < ' tcx > ,
12171215
@@ -1243,13 +1241,12 @@ pub struct ParameterEnvironment<'a, 'tcx:'a> {
12431241 pub free_id_outlive : CodeExtent ,
12441242}
12451243
1246- impl < ' a , ' tcx > ParameterEnvironment < ' a , ' tcx > {
1244+ impl < ' a , ' tcx > ParameterEnvironment < ' tcx > {
12471245 pub fn with_caller_bounds ( & self ,
12481246 caller_bounds : Vec < ty:: Predicate < ' tcx > > )
1249- -> ParameterEnvironment < ' a , ' tcx >
1247+ -> ParameterEnvironment < ' tcx >
12501248 {
12511249 ParameterEnvironment {
1252- tcx : self . tcx ,
12531250 free_substs : self . free_substs . clone ( ) ,
12541251 implicit_region_bound : self . implicit_region_bound ,
12551252 caller_bounds : caller_bounds,
@@ -1260,7 +1257,8 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
12601257 }
12611258
12621259 /// Construct a parameter environment given an item, impl item, or trait item
1263- pub fn for_item ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , id : NodeId ) -> ParameterEnvironment < ' a , ' tcx > {
1260+ pub fn for_item ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , id : NodeId )
1261+ -> ParameterEnvironment < ' tcx > {
12641262 match tcx. map . find ( id) {
12651263 Some ( ast_map:: NodeImplItem ( ref impl_item) ) => {
12661264 match impl_item. node {
@@ -2546,14 +2544,14 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
25462544 ///
25472545 /// (Note that this implies that if `ty` has a destructor attached,
25482546 /// then `type_needs_drop` will definitely return `true` for `ty`.)
2549- pub fn type_needs_drop_given_env < ' b > ( self ,
2550- ty : Ty < ' tcx > ,
2551- param_env : & ty:: ParameterEnvironment < ' b , ' tcx > ) -> bool {
2547+ pub fn type_needs_drop_given_env ( self ,
2548+ ty : Ty < ' tcx > ,
2549+ param_env : & ty:: ParameterEnvironment < ' tcx > ) -> bool {
25522550 // Issue #22536: We first query type_moves_by_default. It sees a
25532551 // normalized version of the type, and therefore will definitely
25542552 // know whether the type implements Copy (and thus needs no
25552553 // cleanup/drop/zeroing) ...
2556- let implements_copy = !ty. moves_by_default ( param_env, DUMMY_SP ) ;
2554+ let implements_copy = !ty. moves_by_default ( self , param_env, DUMMY_SP ) ;
25572555
25582556 if implements_copy { return false ; }
25592557
@@ -2803,13 +2801,12 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
28032801
28042802 /// Construct a parameter environment suitable for static contexts or other contexts where there
28052803 /// are no free type/lifetime parameters in scope.
2806- pub fn empty_parameter_environment ( self ) -> ParameterEnvironment < ' a , ' tcx > {
2804+ pub fn empty_parameter_environment ( self ) -> ParameterEnvironment < ' tcx > {
28072805
28082806 // for an empty parameter environment, there ARE no free
28092807 // regions, so it shouldn't matter what we use for the free id
28102808 let free_id_outlive = self . region_maps . node_extent ( ast:: DUMMY_NODE_ID ) ;
2811- ty:: ParameterEnvironment { tcx : self ,
2812- free_substs : Substs :: empty ( ) ,
2809+ ty:: ParameterEnvironment { free_substs : Substs :: empty ( ) ,
28132810 caller_bounds : Vec :: new ( ) ,
28142811 implicit_region_bound : ty:: ReEmpty ,
28152812 selection_cache : traits:: SelectionCache :: new ( ) ,
@@ -2856,7 +2853,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
28562853 generics : & ty:: Generics < ' tcx > ,
28572854 generic_predicates : & ty:: GenericPredicates < ' tcx > ,
28582855 free_id_outlive : CodeExtent )
2859- -> ParameterEnvironment < ' a , ' tcx >
2856+ -> ParameterEnvironment < ' tcx >
28602857 {
28612858 //
28622859 // Construct the free substs.
@@ -2886,7 +2883,6 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
28862883 //
28872884
28882885 let unnormalized_env = ty:: ParameterEnvironment {
2889- tcx : self ,
28902886 free_substs : free_substs,
28912887 implicit_region_bound : ty:: ReScope ( free_id_outlive) ,
28922888 caller_bounds : predicates,
@@ -2896,7 +2892,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
28962892 } ;
28972893
28982894 let cause = traits:: ObligationCause :: misc ( span, free_id_outlive. node_id ( & self . region_maps ) ) ;
2899- traits:: normalize_param_env_or_error ( unnormalized_env, cause)
2895+ traits:: normalize_param_env_or_error ( self , unnormalized_env, cause)
29002896 }
29012897
29022898 pub fn is_method_call ( self , expr_id : NodeId ) -> bool {
0 commit comments