]> git.lizzy.rs Git - rust.git/commitdiff
Polonius: Rename `parent` and `var_starts_path`
authorAlbin Stjerna <albin.stjerna@gmail.com>
Tue, 6 Aug 2019 10:12:36 +0000 (12:12 +0200)
committerAlbin Stjerna <albin.stjerna@gmail.com>
Wed, 4 Sep 2019 07:46:44 +0000 (09:46 +0200)
src/librustc_mir/borrow_check/nll/facts.rs
src/librustc_mir/borrow_check/nll/mod.rs

index 10ce3a099cf2b5fbab0efbbd0b41ae87d6c78f08..9458b24f07d908cc277a3e1304a7b7da2ab142b1 100644 (file)
@@ -65,9 +65,8 @@ macro_rules! write_facts_to_path {
                 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,
             ])
index 9b920eb15599dd968789884afc18d05e465b7f01..4c76d14bdbbbbf2773a658fa3bb751c2e3b3e548 100644 (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