@@ -24,18 +24,12 @@ pub(super) fn emit_loan_invalidations<'tcx>(
24
24
) {
25
25
let _prof_timer = tcx. prof . generic_activity ( "polonius_fact_generation" ) ;
26
26
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) ;
36
30
}
37
31
38
- struct InvalidationGenerator < ' cx , ' tcx > {
32
+ struct LoanInvalidationsGenerator < ' cx , ' tcx > {
39
33
tcx : TyCtxt < ' tcx > ,
40
34
all_facts : & ' cx mut AllFacts ,
41
35
location_table : & ' cx LocationTable ,
@@ -46,7 +40,7 @@ struct InvalidationGenerator<'cx, 'tcx> {
46
40
47
41
/// Visits the whole MIR and generates `invalidates()` facts.
48
42
/// 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 > {
50
44
fn visit_statement ( & mut self , statement : & Statement < ' tcx > , location : Location ) {
51
45
self . check_activations ( location) ;
52
46
@@ -208,7 +202,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
208
202
}
209
203
}
210
204
211
- impl < ' cx , ' tcx > InvalidationGenerator < ' cx , ' tcx > {
205
+ impl < ' cx , ' tcx > LoanInvalidationsGenerator < ' cx , ' tcx > {
212
206
/// Simulates mutation of a place.
213
207
fn mutate_place ( & mut self , location : Location , place : Place < ' tcx > , kind : AccessDepth ) {
214
208
self . access_place (
@@ -342,20 +336,16 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
342
336
rw : ReadOrWrite ,
343
337
) {
344
338
debug ! (
345
- "invalidation::check_access_for_conflict(location={:?}, place={:?}, sd={:?}, \
346
- rw={:?})",
339
+ "check_access_for_conflict(location={:?}, place={:?}, sd={:?}, rw={:?})" ,
347
340
location, place, sd, rw,
348
341
) ;
349
- let tcx = self . tcx ;
350
- let body = self . body ;
351
- let borrow_set = self . borrow_set ;
352
342
each_borrow_involving_path (
353
343
self ,
354
- tcx,
355
- body,
344
+ self . tcx ,
345
+ self . body ,
356
346
location,
357
347
( sd, place) ,
358
- borrow_set,
348
+ self . borrow_set ,
359
349
|_| true ,
360
350
|this, borrow_index, borrow| {
361
351
match ( rw, borrow. kind ) {
0 commit comments