1
Fork 0

Polonius: Rename parent and var_starts_path

This commit is contained in:
Albin Stjerna 2019-08-06 12:12:36 +02:00
parent 6b09477e91
commit 9f39e001df
2 changed files with 5 additions and 6 deletions

View file

@ -65,9 +65,8 @@ impl AllFactsExt for AllFacts {
var_drop_used,
var_uses_region,
var_drops_region,
var_maybe_initialized_on_exit,
parent,
var_starts_path,
child,
path_belongs_to_var,
initialized_at,
moved_out_at,
])

View file

@ -73,10 +73,10 @@ pub(in crate::borrow_check) fn replace_regions_in_mir<'cx, 'tcx>(
// This function populates an AllFacts instance with base facts related to
// MovePaths and needed for the move analysis.
fn populate_polonius_move_facts(all_facts: &mut AllFacts, move_data: &MoveData<'_>, location_table: &LocationTable, body: &Body<'_>) {
all_facts.var_starts_path.extend(move_data.rev_lookup.iter_locals_enumerated().map(|(v, &m)| (v, m)));
all_facts.path_belongs_to_var.extend(move_data.rev_lookup.iter_locals_enumerated().map(|(v, &m)| (m, v)));
for (idx, move_path) in move_data.move_paths.iter_enumerated() {
all_facts.parent.extend(move_path.parents(&move_data.move_paths).iter().map(|&parent| (parent, idx)));
for (child, move_path) in move_data.move_paths.iter_enumerated() {
all_facts.child.extend(move_path.parents(&move_data.move_paths).iter().map(|&parent| (child, parent)));
}
// initialized_at