rust/compiler/rustc_middle/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
..
dep_graph Reduce exposure of things. 2023-11-16 16:49:22 +11:00
hir Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
hooks Rename hook. 2023-11-01 16:49:18 +00:00
infer NFC: do not clone types that are copy 2023-12-15 23:19:51 +01:00
middle Make iteration order of region_scope_tree query stable 2024-01-04 13:48:54 +01:00
mir Rollup merge of #119566 - Zalathar:remove-spanview, r=Swatinem,Nilstrieb 2024-01-05 10:57:21 -05:00
query Auto merge of #119192 - michaelwoerister:mcp533-push, r=cjgillot 2024-01-05 19:38:27 +00:00
thir thir::Visitor only needs to visit &'thir data 2023-12-26 03:15:18 +00:00
traits Track HirId instead of Span in ObligationCauseCode::SizedArgumentType 2024-01-03 18:59:42 +00:00
ty Make iteration order of collect_return_position_impl_trait_in_trait_tys query stable 2024-01-04 13:48:57 +01:00
util Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
arena.rs Make iteration order of collect_return_position_impl_trait_in_trait_tys query stable 2024-01-04 13:48:57 +01:00
error.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
lib.rs update cfg(bootstrap)s 2023-12-22 11:14:11 +01:00
lint.rs Remove is_lint field from Level::Error. 2024-01-04 16:09:31 +11:00
macros.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs
thir.rs Don't include destruction scopes in THIR 2023-12-04 16:31:13 +00:00
values.rs Remove more Session methods that duplicate DiagCtxt methods. 2023-12-24 08:17:47 +11:00