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_hir_analysis/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_hir_analysis/src')
0 files changed, 0 insertions, 0 deletions
