@@ -15,24 +15,24 @@ use tracing::debug;
1515use crate :: { places_conflict, BorrowSet , PlaceConflictBias , PlaceExt , RegionInferenceContext } ;
1616
1717/// The results of the dataflow analyses used by the borrow checker.
18- pub ( crate ) struct BorrowckResults < ' a , ' mir , ' tcx > {
19- pub ( crate ) borrows : Results < ' tcx , Borrows < ' a , ' mir , ' tcx > > ,
20- pub ( crate ) uninits : Results < ' tcx , MaybeUninitializedPlaces < ' a , ' mir , ' tcx > > ,
21- pub ( crate ) ever_inits : Results < ' tcx , EverInitializedPlaces < ' a , ' mir , ' tcx > > ,
18+ pub ( crate ) struct BorrowckResults < ' a , ' tcx > {
19+ pub ( crate ) borrows : Results < ' tcx , Borrows < ' a , ' tcx > > ,
20+ pub ( crate ) uninits : Results < ' tcx , MaybeUninitializedPlaces < ' a , ' tcx > > ,
21+ pub ( crate ) ever_inits : Results < ' tcx , EverInitializedPlaces < ' a , ' tcx > > ,
2222}
2323
2424/// The transient state of the dataflow analyses used by the borrow checker.
2525#[ derive( Debug ) ]
26- pub ( crate ) struct BorrowckFlowState < ' a , ' mir , ' tcx > {
27- pub ( crate ) borrows : <Borrows < ' a , ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
28- pub ( crate ) uninits : <MaybeUninitializedPlaces < ' a , ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
29- pub ( crate ) ever_inits : <EverInitializedPlaces < ' a , ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
26+ pub ( crate ) struct BorrowckFlowState < ' a , ' tcx > {
27+ pub ( crate ) borrows : <Borrows < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
28+ pub ( crate ) uninits : <MaybeUninitializedPlaces < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
29+ pub ( crate ) ever_inits : <EverInitializedPlaces < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
3030}
3131
32- impl < ' a , ' mir , ' tcx > ResultsVisitable < ' tcx > for BorrowckResults < ' a , ' mir , ' tcx > {
32+ impl < ' a , ' tcx > ResultsVisitable < ' tcx > for BorrowckResults < ' a , ' tcx > {
3333 // All three analyses are forward, but we have to use just one here.
34- type Direction = <Borrows < ' a , ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Direction ;
35- type FlowState = BorrowckFlowState < ' a , ' mir , ' tcx > ;
34+ type Direction = <Borrows < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Direction ;
35+ type FlowState = BorrowckFlowState < ' a , ' tcx > ;
3636
3737 fn new_flow_state ( & self , body : & mir:: Body < ' tcx > ) -> Self :: FlowState {
3838 BorrowckFlowState {
@@ -106,10 +106,9 @@ rustc_index::newtype_index! {
106106/// `BorrowIndex`, and maps each such index to a `BorrowData`
107107/// describing the borrow. These indexes are used for representing the
108108/// borrows in compact bitvectors.
109- pub struct Borrows < ' a , ' mir , ' tcx > {
109+ pub struct Borrows < ' a , ' tcx > {
110110 tcx : TyCtxt < ' tcx > ,
111- body : & ' mir Body < ' tcx > ,
112-
111+ body : & ' a Body < ' tcx > ,
113112 borrow_set : & ' a BorrowSet < ' tcx > ,
114113 borrows_out_of_scope_at_location : FxIndexMap < Location , Vec < BorrowIndex > > ,
115114}
@@ -389,10 +388,10 @@ impl<'tcx> PoloniusOutOfScopePrecomputer<'_, 'tcx> {
389388 }
390389}
391390
392- impl < ' a , ' mir , ' tcx > Borrows < ' a , ' mir , ' tcx > {
391+ impl < ' a , ' tcx > Borrows < ' a , ' tcx > {
393392 pub fn new (
394393 tcx : TyCtxt < ' tcx > ,
395- body : & ' mir Body < ' tcx > ,
394+ body : & ' a Body < ' tcx > ,
396395 regioncx : & RegionInferenceContext < ' tcx > ,
397396 borrow_set : & ' a BorrowSet < ' tcx > ,
398397 ) -> Self {
@@ -494,7 +493,7 @@ impl<'a, 'mir, 'tcx> Borrows<'a, 'mir, 'tcx> {
494493 }
495494}
496495
497- impl < ' tcx > rustc_mir_dataflow:: AnalysisDomain < ' tcx > for Borrows < ' _ , ' _ , ' tcx > {
496+ impl < ' tcx > rustc_mir_dataflow:: AnalysisDomain < ' tcx > for Borrows < ' _ , ' tcx > {
498497 type Domain = BitSet < BorrowIndex > ;
499498
500499 const NAME : & ' static str = "borrows" ;
@@ -517,7 +516,7 @@ impl<'tcx> rustc_mir_dataflow::AnalysisDomain<'tcx> for Borrows<'_, '_, 'tcx> {
517516/// region stops containing the CFG points reachable from the issuing location.
518517/// - we also kill loans of conflicting places when overwriting a shared path: e.g. borrows of
519518/// `a.b.c` when `a` is overwritten.
520- impl < ' tcx > rustc_mir_dataflow:: GenKillAnalysis < ' tcx > for Borrows < ' _ , ' _ , ' tcx > {
519+ impl < ' tcx > rustc_mir_dataflow:: GenKillAnalysis < ' tcx > for Borrows < ' _ , ' tcx > {
521520 type Idx = BorrowIndex ;
522521
523522 fn domain_size ( & self , _: & mir:: Body < ' tcx > ) -> usize {
@@ -617,8 +616,8 @@ impl<'tcx> rustc_mir_dataflow::GenKillAnalysis<'tcx> for Borrows<'_, '_, 'tcx> {
617616 }
618617}
619618
620- impl DebugWithContext < Borrows < ' _ , ' _ , ' _ > > for BorrowIndex {
621- fn fmt_with ( & self , ctxt : & Borrows < ' _ , ' _ , ' _ > , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
619+ impl DebugWithContext < Borrows < ' _ , ' _ > > for BorrowIndex {
620+ fn fmt_with ( & self , ctxt : & Borrows < ' _ , ' _ > , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
622621 write ! ( f, "{:?}" , ctxt. location( * self ) )
623622 }
624623}
0 commit comments