@@ -24,18 +24,12 @@ pub(super) fn emit_loan_invalidations<'tcx>(
2424) {
2525 let _prof_timer = tcx. prof . generic_activity ( "polonius_fact_generation" ) ;
2626 let dominators = body. basic_blocks . dominators ( ) ;
27- let mut ig = InvalidationGenerator {
28- all_facts,
29- borrow_set,
30- tcx,
31- location_table,
32- body : body,
33- dominators,
34- } ;
35- ig. visit_body ( body) ;
27+ let mut visitor =
28+ LoanInvalidationsGenerator { all_facts, borrow_set, tcx, location_table, body, dominators } ;
29+ visitor. visit_body ( body) ;
3630}
3731
38- struct InvalidationGenerator < ' cx , ' tcx > {
32+ struct LoanInvalidationsGenerator < ' cx , ' tcx > {
3933 tcx : TyCtxt < ' tcx > ,
4034 all_facts : & ' cx mut AllFacts ,
4135 location_table : & ' cx LocationTable ,
@@ -46,7 +40,7 @@ struct InvalidationGenerator<'cx, 'tcx> {
4640
4741/// Visits the whole MIR and generates `invalidates()` facts.
4842/// Most of the code implementing this was stolen from `borrow_check/mod.rs`.
49- impl < ' cx , ' tcx > Visitor < ' tcx > for InvalidationGenerator < ' cx , ' tcx > {
43+ impl < ' cx , ' tcx > Visitor < ' tcx > for LoanInvalidationsGenerator < ' cx , ' tcx > {
5044 fn visit_statement ( & mut self , statement : & Statement < ' tcx > , location : Location ) {
5145 self . check_activations ( location) ;
5246
@@ -208,7 +202,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
208202 }
209203}
210204
211- impl < ' cx , ' tcx > InvalidationGenerator < ' cx , ' tcx > {
205+ impl < ' cx , ' tcx > LoanInvalidationsGenerator < ' cx , ' tcx > {
212206 /// Simulates mutation of a place.
213207 fn mutate_place ( & mut self , location : Location , place : Place < ' tcx > , kind : AccessDepth ) {
214208 self . access_place (
@@ -342,20 +336,16 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
342336 rw : ReadOrWrite ,
343337 ) {
344338 debug ! (
345- "invalidation::check_access_for_conflict(location={:?}, place={:?}, sd={:?}, \
346- rw={:?})",
339+ "check_access_for_conflict(location={:?}, place={:?}, sd={:?}, rw={:?})" ,
347340 location, place, sd, rw,
348341 ) ;
349- let tcx = self . tcx ;
350- let body = self . body ;
351- let borrow_set = self . borrow_set ;
352342 each_borrow_involving_path (
353343 self ,
354- tcx,
355- body,
344+ self . tcx ,
345+ self . body ,
356346 location,
357347 ( sd, place) ,
358- borrow_set,
348+ self . borrow_set ,
359349 |_| true ,
360350 |this, borrow_index, borrow| {
361351 match ( rw, borrow. kind ) {
0 commit comments