about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_data_structures/src/unord.rs5
-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
4 files changed, 23 insertions, 26 deletions
diff --git a/compiler/rustc_data_structures/src/unord.rs b/compiler/rustc_data_structures/src/unord.rs
index 02957b38efe..6c8d5414631 100644
--- a/compiler/rustc_data_structures/src/unord.rs
+++ b/compiler/rustc_data_structures/src/unord.rs
@@ -63,11 +63,6 @@ impl<T, I: Iterator<Item = T>> UnordItems<T, I> {
     }
 
     #[inline]
-    pub fn for_each<F: Fn(T) -> ()>(self, f: F) {
-        self.0.for_each(|x| f(x));
-    }
-
-    #[inline]
     pub fn max(self) -> Option<T>
     where
         T: Ord,
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 });