@@ -14,20 +14,20 @@ use crate::places_conflict;
14
14
/// Emit `loan_killed_at` and `cfg_edge` facts at the same time.
15
15
pub ( super ) fn emit_loan_kills < ' tcx > (
16
16
tcx : TyCtxt < ' tcx > ,
17
- all_facts : & mut AllFacts ,
18
- location_table : & LocationTable ,
17
+ facts : & mut AllFacts ,
19
18
body : & Body < ' tcx > ,
19
+ location_table : & LocationTable ,
20
20
borrow_set : & BorrowSet < ' tcx > ,
21
21
) {
22
- let mut visitor = LoanKillsGenerator { borrow_set, tcx, location_table, all_facts , body } ;
22
+ let mut visitor = LoanKillsGenerator { borrow_set, tcx, location_table, facts , body } ;
23
23
for ( bb, data) in body. basic_blocks . iter_enumerated ( ) {
24
24
visitor. visit_basic_block_data ( bb, data) ;
25
25
}
26
26
}
27
27
28
28
struct LoanKillsGenerator < ' a , ' tcx > {
29
29
tcx : TyCtxt < ' tcx > ,
30
- all_facts : & ' a mut AllFacts ,
30
+ facts : & ' a mut AllFacts ,
31
31
location_table : & ' a LocationTable ,
32
32
borrow_set : & ' a BorrowSet < ' tcx > ,
33
33
body : & ' a Body < ' tcx > ,
@@ -36,12 +36,12 @@ struct LoanKillsGenerator<'a, 'tcx> {
36
36
impl < ' a , ' tcx > Visitor < ' tcx > for LoanKillsGenerator < ' a , ' tcx > {
37
37
fn visit_statement ( & mut self , statement : & Statement < ' tcx > , location : Location ) {
38
38
// Also record CFG facts here.
39
- self . all_facts . cfg_edge . push ( (
39
+ self . facts . cfg_edge . push ( (
40
40
self . location_table . start_index ( location) ,
41
41
self . location_table . mid_index ( location) ,
42
42
) ) ;
43
43
44
- self . all_facts . cfg_edge . push ( (
44
+ self . facts . cfg_edge . push ( (
45
45
self . location_table . mid_index ( location) ,
46
46
self . location_table . start_index ( location. successor_within_block ( ) ) ,
47
47
) ) ;
@@ -63,15 +63,15 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanKillsGenerator<'a, 'tcx> {
63
63
64
64
fn visit_terminator ( & mut self , terminator : & Terminator < ' tcx > , location : Location ) {
65
65
// Also record CFG facts here.
66
- self . all_facts . cfg_edge . push ( (
66
+ self . facts . cfg_edge . push ( (
67
67
self . location_table . start_index ( location) ,
68
68
self . location_table . mid_index ( location) ,
69
69
) ) ;
70
70
71
71
let successor_blocks = terminator. successors ( ) ;
72
- self . all_facts . cfg_edge . reserve ( successor_blocks. size_hint ( ) . 0 ) ;
72
+ self . facts . cfg_edge . reserve ( successor_blocks. size_hint ( ) . 0 ) ;
73
73
for successor_block in successor_blocks {
74
- self . all_facts . cfg_edge . push ( (
74
+ self . facts . cfg_edge . push ( (
75
75
self . location_table . mid_index ( location) ,
76
76
self . location_table . start_index ( successor_block. start_location ( ) ) ,
77
77
) ) ;
@@ -128,7 +128,7 @@ impl<'tcx> LoanKillsGenerator<'_, 'tcx> {
128
128
129
129
if places_conflict {
130
130
let location_index = self . location_table . mid_index ( location) ;
131
- self . all_facts . loan_killed_at . push ( ( borrow_index, location_index) ) ;
131
+ self . facts . loan_killed_at . push ( ( borrow_index, location_index) ) ;
132
132
}
133
133
}
134
134
}
@@ -140,9 +140,9 @@ impl<'tcx> LoanKillsGenerator<'_, 'tcx> {
140
140
fn record_killed_borrows_for_local ( & mut self , local : Local , location : Location ) {
141
141
if let Some ( borrow_indices) = self . borrow_set . local_map . get ( & local) {
142
142
let location_index = self . location_table . mid_index ( location) ;
143
- self . all_facts . loan_killed_at . reserve ( borrow_indices. len ( ) ) ;
143
+ self . facts . loan_killed_at . reserve ( borrow_indices. len ( ) ) ;
144
144
for & borrow_index in borrow_indices {
145
- self . all_facts . loan_killed_at . push ( ( borrow_index, location_index) ) ;
145
+ self . facts . loan_killed_at . push ( ( borrow_index, location_index) ) ;
146
146
}
147
147
}
148
148
}
0 commit comments