diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2023-12-21 10:27:34 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2024-01-04 13:32:42 +0100 |
| commit | 739e5ef49e28ea4b2ab20bd28251a2299bd6889c (patch) | |
| tree | 442c90e4c8b53e88e99636f8ef509394ed8936ae /compiler/rustc_incremental/src | |
| parent | 090d5eac722000906cc00d991f2bf052b0e388c3 (diff) | |
| download | rust-739e5ef49e28ea4b2ab20bd28251a2299bd6889c.tar.gz rust-739e5ef49e28ea4b2ab20bd28251a2299bd6889c.zip | |
Split StableCompare trait out of StableOrd trait.
StableCompare is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableOrd` implementation can be provided to offer a lightweight way for stable sorting. (The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.)
Diffstat (limited to 'compiler/rustc_incremental/src')
| -rw-r--r-- | compiler/rustc_incremental/src/persist/save.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index bdc935a5e3b..08b7d08bcc0 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -103,7 +103,7 @@ pub fn save_work_product_index( // deleted during invalidation. Some object files don't change their // content, they are just not needed anymore. let previous_work_products = dep_graph.previous_work_products(); - for (id, wp) in previous_work_products.to_sorted_stable_ord().iter() { + for (id, wp) in previous_work_products.to_sorted_stable_ord() { if !new_work_products.contains_key(id) { work_product::delete_workproduct_files(sess, wp); debug_assert!( |
