rust/compiler/rustc_hir_analysis/src/check
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
..
compare_impl_item Fix some comments 2023-12-28 12:23:14 +08:00
check.rs Reorder check_item_type diagnostics so they occur next to the corresponding check_well_formed diagnostics 2024-01-02 14:17:56 +00:00
compare_impl_item.rs Make iteration order of collect_return_position_impl_trait_in_trait_tys query stable 2024-01-04 13:48:57 +01:00
dropck.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
entry.rs Merge check_for_entry_fn fully into check_mod_type_wf 2024-01-02 14:17:56 +00:00
intrinsic.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
intrinsicck.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
mod.rs Merge check_for_entry_fn fully into check_mod_type_wf 2024-01-02 14:17:56 +00:00
region.rs Remove unnecessary body_expr_count 2023-12-25 16:28:56 +00:00
wfcheck.rs Merge check_for_entry_fn fully into check_mod_type_wf 2024-01-02 14:17:56 +00:00