@@ -14,7 +14,7 @@ use rustc_middle::mir::{
14
14
visit:: { MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor as _} ,
15
15
Mutability ,
16
16
} ;
17
- use rustc_middle:: ty:: { self , fold:: TypeVisitor , Ty , TyCtxt } ;
17
+ use rustc_middle:: ty:: { self , fold:: TypeVisitor , Ty } ;
18
18
use rustc_mir_dataflow:: { Analysis , AnalysisDomain , CallReturnPlaces , GenKill , GenKillAnalysis , ResultsCursor } ;
19
19
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
20
20
use rustc_span:: source_map:: { BytePos , Span } ;
@@ -575,7 +575,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
575
575
self . possible_borrower . add ( borrowed. local , lhs) ;
576
576
} ,
577
577
other => {
578
- if ContainsRegion ( self . cx . tcx )
578
+ if ContainsRegion
579
579
. visit_ty ( place. ty ( & self . body . local_decls , self . cx . tcx ) . ty )
580
580
. is_continue ( )
581
581
{
@@ -624,7 +624,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
624
624
. flat_map ( HybridBitSet :: iter)
625
625
. collect ( ) ;
626
626
627
- if ContainsRegion ( self . cx . tcx )
627
+ if ContainsRegion
628
628
. visit_ty ( self . body . local_decls [ * dest] . ty )
629
629
. is_break ( )
630
630
{
@@ -703,15 +703,12 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleOriginVisitor<'a, 'tcx> {
703
703
}
704
704
}
705
705
706
- struct ContainsRegion < ' tcx > ( TyCtxt < ' tcx > ) ;
706
+ struct ContainsRegion ;
707
707
708
- impl < ' tcx > TypeVisitor < ' tcx > for ContainsRegion < ' tcx > {
708
+ impl TypeVisitor < ' _ > for ContainsRegion {
709
709
type BreakTy = ( ) ;
710
- fn tcx_for_anon_const_substs ( & self ) -> Option < TyCtxt < ' tcx > > {
711
- Some ( self . 0 )
712
- }
713
710
714
- fn visit_region ( & mut self , _: ty:: Region < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
711
+ fn visit_region ( & mut self , _: ty:: Region < ' _ > ) -> ControlFlow < Self :: BreakTy > {
715
712
ControlFlow :: BREAK
716
713
}
717
714
}
0 commit comments