about summary refs log tree commit diff
path: root/compiler/rustc_incremental/src
diff options
context:
space:
mode:
authorAndrew Xie <ndrew.xie@gmail.com>2023-05-08 17:26:17 -0400
committerAndrew Xie <ndrew.xie@gmail.com>2023-06-04 21:55:32 -0400
commit6f2d3dee1790f8066394d1198fd1864b5fae45a3 (patch)
tree633b4171f38ce68f1bdfe6d6a9eee37931492f9f /compiler/rustc_incremental/src
parent96b577860d4e175ccc4698b9e9a8a822b228fc19 (diff)
downloadrust-6f2d3dee1790f8066394d1198fd1864b5fae45a3.tar.gz
rust-6f2d3dee1790f8066394d1198fd1864b5fae45a3.zip
Fixed unord mistake
Diffstat (limited to 'compiler/rustc_incremental/src')
-rw-r--r--compiler/rustc_incremental/src/persist/dirty_clean.rs6
-rw-r--r--compiler/rustc_incremental/src/persist/fs.rs36
-rw-r--r--compiler/rustc_incremental/src/persist/work_product.rs2
3 files changed, 23 insertions, 21 deletions
diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs
index b7bdffe5b06..6381a05dfdc 100644
--- a/compiler/rustc_incremental/src/persist/dirty_clean.rs
+++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs
@@ -377,15 +377,15 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
                 continue;
             };
             self.checked_attrs.insert(attr.id);
-            assertion.clean.items().for_each(|label| {
+            assertion.clean.to_sorted(&(), false).iter().for_each(|label| {
                 let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
                 self.assert_clean(item_span, dep_node);
             });
-            assertion.dirty.items().for_each(|label| {
+            assertion.dirty.to_sorted(&(), false).iter().for_each(|label| {
                 let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
                 self.assert_dirty(item_span, dep_node);
             });
-            assertion.loaded_from_disk.items().for_each(|label| {
+            assertion.loaded_from_disk.to_sorted(&(), false).iter().for_each(|label| {
                 let dep_node = DepNode::from_label_string(self.tcx, &label, def_path_hash).unwrap();
                 self.assert_loaded_from_disk(item_span, dep_node);
             });
diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs
index c3f1abadace..f0e5f07230f 100644
--- a/compiler/rustc_incremental/src/persist/fs.rs
+++ b/compiler/rustc_incremental/src/persist/fs.rs
@@ -674,9 +674,10 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
 
     // Delete all lock files, that don't have an associated directory. They must
     // be some kind of leftover
-    lock_file_to_session_dir.items().for_each(|(lock_file_name, directory_name)| {
-        if directory_name.is_none() {
-            let Ok(timestamp) = extract_timestamp_from_session_dir(lock_file_name) else {
+    lock_file_to_session_dir.to_sorted(&(), false).iter().for_each(
+        |(lock_file_name, directory_name)| {
+            if directory_name.is_none() {
+                let Ok(timestamp) = extract_timestamp_from_session_dir(lock_file_name) else {
                 debug!(
                     "found lock-file with malformed timestamp: {}",
                     crate_directory.join(&lock_file_name).display()
@@ -685,24 +686,25 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
                 return;
             };
 
-            let lock_file_path = crate_directory.join(&**lock_file_name);
+                let lock_file_path = crate_directory.join(&**lock_file_name);
 
-            if is_old_enough_to_be_collected(timestamp) {
-                debug!(
-                    "garbage_collect_session_directories() - deleting \
+                if is_old_enough_to_be_collected(timestamp) {
+                    debug!(
+                        "garbage_collect_session_directories() - deleting \
                         garbage lock file: {}",
-                    lock_file_path.display()
-                );
-                delete_session_dir_lock_file(sess, &lock_file_path);
-            } else {
-                debug!(
-                    "garbage_collect_session_directories() - lock file with \
+                        lock_file_path.display()
+                    );
+                    delete_session_dir_lock_file(sess, &lock_file_path);
+                } else {
+                    debug!(
+                        "garbage_collect_session_directories() - lock file with \
                         no session dir not old enough to be collected: {}",
-                    lock_file_path.display()
-                );
+                        lock_file_path.display()
+                    );
+                }
             }
-        }
-    });
+        },
+    );
 
     // Filter out `None` directories
     let lock_file_to_session_dir: UnordMap<String, String> =
diff --git a/compiler/rustc_incremental/src/persist/work_product.rs b/compiler/rustc_incremental/src/persist/work_product.rs
index 865f90273bd..b0d173ab304 100644
--- a/compiler/rustc_incremental/src/persist/work_product.rs
+++ b/compiler/rustc_incremental/src/persist/work_product.rs
@@ -46,7 +46,7 @@ pub fn copy_cgu_workproduct_to_incr_comp_cache_dir(
 
 /// Removes files for a given work product.
 pub fn delete_workproduct_files(sess: &Session, work_product: &WorkProduct) {
-    work_product.saved_files.items().for_each(|(_, path)| {
+    work_product.saved_files.to_sorted(&(), false).iter().for_each(|(_, path)| {
         let path = in_incr_comp_dir_sess(sess, path);
         if let Err(err) = std_fs::remove_file(&path) {
             sess.emit_warning(errors::DeleteWorkProduct { path: &path, err });