@@ -14,7 +14,7 @@ use rustc_middle::mir::{
1414 visit:: { MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor as _} ,
1515 Mutability ,
1616} ;
17- use rustc_middle:: ty:: { self , fold:: TypeVisitor , Ty , TyCtxt } ;
17+ use rustc_middle:: ty:: { self , fold:: TypeVisitor , Ty } ;
1818use rustc_mir_dataflow:: { Analysis , AnalysisDomain , CallReturnPlaces , GenKill , GenKillAnalysis , ResultsCursor } ;
1919use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
2020use rustc_span:: source_map:: { BytePos , Span } ;
@@ -575,7 +575,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
575575 self . possible_borrower . add ( borrowed. local , lhs) ;
576576 } ,
577577 other => {
578- if ContainsRegion ( self . cx . tcx )
578+ if ContainsRegion
579579 . visit_ty ( place. ty ( & self . body . local_decls , self . cx . tcx ) . ty )
580580 . is_continue ( )
581581 {
@@ -624,7 +624,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
624624 . flat_map ( HybridBitSet :: iter)
625625 . collect ( ) ;
626626
627- if ContainsRegion ( self . cx . tcx )
627+ if ContainsRegion
628628 . visit_ty ( self . body . local_decls [ * dest] . ty )
629629 . is_break ( )
630630 {
@@ -703,15 +703,12 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleOriginVisitor<'a, 'tcx> {
703703 }
704704}
705705
706- struct ContainsRegion < ' tcx > ( TyCtxt < ' tcx > ) ;
706+ struct ContainsRegion ;
707707
708- impl < ' tcx > TypeVisitor < ' tcx > for ContainsRegion < ' tcx > {
708+ impl TypeVisitor < ' _ > for ContainsRegion {
709709 type BreakTy = ( ) ;
710- fn tcx_for_anon_const_substs ( & self ) -> Option < TyCtxt < ' tcx > > {
711- Some ( self . 0 )
712- }
713710
714- fn visit_region ( & mut self , _: ty:: Region < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
711+ fn visit_region ( & mut self , _: ty:: Region < ' _ > ) -> ControlFlow < Self :: BreakTy > {
715712 ControlFlow :: BREAK
716713 }
717714}
0 commit comments