rust/compiler/rustc_span/src
bors b8c207435c Auto merge of #119192 - michaelwoerister:mcp533-push, r=cjgillot
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which 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 `StableCompare` 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`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).
2024-01-05 19:38:27 +00:00
..
analyze_source_file Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
edit_distance Add test for precise algorithm used 2023-02-19 22:59:22 +00:00
source_map Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
symbol Use FxIndexSet in the symbol interner. 2023-11-03 07:19:41 +11:00
analyze_source_file.rs Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
caching_source_map_view.rs Add better ICE messages for some undescriptive panics 2023-12-15 00:50:55 -05:00
def_id.rs Make iteration order of region_scope_tree query stable 2024-01-04 13:48:54 +01:00
edit_distance.rs rustc_span: Use correct edit distance start length for suggestions 2023-11-27 19:08:27 +01:00
edition.rs Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
fatal_error.rs Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov 2023-11-09 00:39:02 +00:00
hygiene.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
lib.rs Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
profiling.rs Remove an unnecessary use of with_session_globals. 2023-03-31 15:34:00 +11:00
source_map.rs Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
span_encoding.rs debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
symbol.rs Auto merge of #119192 - michaelwoerister:mcp533-push, r=cjgillot 2024-01-05 19:38:27 +00:00
tests.rs Use Freeze for SourceFile.lines 2023-09-07 13:05:05 +02:00