@@ -46,7 +46,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
4646            return  None ; 
4747        } 
4848
49-         let  result = f. find_auto_trait_generics ( ty,  param_env,  trait_def_id,  |infcx ,   info| { 
49+         let  result = f. find_auto_trait_generics ( ty,  param_env,  trait_def_id,  |info| { 
5050            let  region_data = info. region_data ; 
5151
5252            let  names_map = tcx
@@ -61,7 +61,6 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
6161                . collect ( ) ; 
6262            let  lifetime_predicates = Self :: handle_lifetimes ( & region_data,  & names_map) ; 
6363            let  new_generics = self . param_env_to_generics ( 
64-                 infcx. tcx , 
6564                item_def_id, 
6665                info. full_user_env , 
6766                lifetime_predicates, 
@@ -313,12 +312,9 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
313312        lifetime_predicates
314313    } 
315314
316-     fn  extract_for_generics ( 
317-         & self , 
318-         tcx :  TyCtxt < ' tcx > , 
319-         pred :  ty:: Predicate < ' tcx > , 
320-     )  -> FxHashSet < GenericParamDef >  { 
315+     fn  extract_for_generics ( & self ,  pred :  ty:: Predicate < ' tcx > )  -> FxHashSet < GenericParamDef >  { 
321316        let  bound_predicate = pred. kind ( ) ; 
317+         let  tcx = self . cx . tcx ; 
322318        let  regions = match  bound_predicate. skip_binder ( )  { 
323319            ty:: PredicateKind :: Trait ( poly_trait_pred,  _)  => { 
324320                tcx. collect_referenced_late_bound_regions ( & bound_predicate. rebind ( poly_trait_pred) ) 
@@ -443,7 +439,6 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
443439    // * We explicitly add a '?Sized' bound if we didn't find any 'Sized' predicates for a type 
444440    fn  param_env_to_generics ( 
445441        & mut  self , 
446-         tcx :  TyCtxt < ' tcx > , 
447442        item_def_id :  DefId , 
448443        param_env :  ty:: ParamEnv < ' tcx > , 
449444        mut  existing_predicates :  Vec < WherePredicate > , 
@@ -455,14 +450,15 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
455450            item_def_id,  param_env,  existing_predicates
456451        ) ; 
457452
453+         let  tcx = self . cx . tcx ; 
454+ 
458455        // The `Sized` trait must be handled specially, since we only display it when 
459456        // it is *not* required (i.e., '?Sized') 
460-         let  sized_trait = self . cx . tcx . require_lang_item ( LangItem :: Sized ,  None ) ; 
457+         let  sized_trait = tcx. require_lang_item ( LangItem :: Sized ,  None ) ; 
461458
462459        let  mut  replacer = RegionReplacer  {  vid_to_region :  & vid_to_region,  tcx } ; 
463460
464-         let  orig_bounds:  FxHashSet < _ >  =
465-             self . cx . tcx . param_env ( item_def_id) . caller_bounds ( ) . iter ( ) . collect ( ) ; 
461+         let  orig_bounds:  FxHashSet < _ >  = tcx. param_env ( item_def_id) . caller_bounds ( ) . iter ( ) . collect ( ) ; 
466462        let  clean_where_predicates = param_env
467463            . caller_bounds ( ) 
468464            . iter ( ) 
@@ -512,7 +508,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
512508                        continue ; 
513509                    } 
514510
515-                     let  mut  for_generics = self . extract_for_generics ( tcx ,   orig_p) ; 
511+                     let  mut  for_generics = self . extract_for_generics ( orig_p) ; 
516512
517513                    assert ! ( bounds. len( )  == 1 ) ; 
518514                    let  mut  b = bounds. pop ( ) . expect ( "bounds were empty" ) ; 
@@ -541,7 +537,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
541537                                // that we don't end up with duplicate bounds (e.g., for<'b, 'b>) 
542538                                for_generics. extend ( p. generic_params . clone ( ) ) ; 
543539                                p. generic_params  = for_generics. into_iter ( ) . collect ( ) ; 
544-                                 self . is_fn_ty ( tcx ,   & p. trait_ ) 
540+                                 self . is_fn_ty ( & p. trait_ ) 
545541                            } 
546542                            _ => false , 
547543                        } ; 
@@ -576,7 +572,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
576572                                }  => { 
577573                                    let  mut  new_trait_path = trait_path. clone ( ) ; 
578574
579-                                     if  self . is_fn_ty ( tcx ,   trait_)  && left_name == sym:: Output  { 
575+                                     if  self . is_fn_ty ( trait_)  && left_name == sym:: Output  { 
580576                                        ty_to_fn
581577                                            . entry ( * ty. clone ( ) ) 
582578                                            . and_modify ( |e| * e = ( e. 0 . clone ( ) ,  Some ( rhs. clone ( ) ) ) ) 
@@ -734,7 +730,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
734730        vec. sort_by_cached_key ( |x| format ! ( "{:?}" ,  x) ) 
735731    } 
736732
737-     fn  is_fn_ty ( & self ,  tcx :  TyCtxt < ' _ > ,  ty :  & Type )  -> bool  { 
733+     fn  is_fn_ty ( & self ,  ty :  & Type )  -> bool  { 
734+         let  tcx = self . cx . tcx ; 
738735        match  ty { 
739736            & Type :: ResolvedPath  {  did,  .. }  => { 
740737                did == tcx. require_lang_item ( LangItem :: Fn ,  None ) 
0 commit comments