rust/compiler/rustc_passes/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
..
liveness Match unmatched backticks in compiler/ that are part of rustdoc 2023-03-03 08:39:00 +01:00
abi_test.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
check_attr.rs Rename some Diagnostic setters. 2024-01-03 19:40:20 +11:00
check_const.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
dead.rs Merge unused_tuple_struct_fields into dead_code 2024-01-02 15:34:37 -05:00
debugger_visualizer.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
diagnostic_items.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
entry.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
errors.rs Rename some Diagnostic setters. 2024-01-03 19:40:20 +11:00
hir_id_validator.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
hir_stats.rs banish hir::GenericBound::LangItemTrait 2023-12-15 16:17:27 +00:00
lang_items.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
layout_test.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
lib.rs Pass DeadItem and lint as consistent group in dead-code. 2023-12-25 13:15:28 +00:00
lib_features.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
liveness.rs Rollup merge of #119402 - est31:fix_if_guard_unused, r=compiler-errors 2023-12-29 11:19:28 +01:00
loops.rs Auto merge of #119258 - compiler-errors:closure-kind, r=eholk 2023-12-26 04:25:53 +00:00
naked_functions.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
reachable.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
stability.rs Address review comments and add back some #[inline] attrs from removed commits. 2024-01-04 13:51:06 +01:00
upvars.rs is_coroutine -> is_coroutine_or_closure 2023-12-30 15:24:15 +00:00
weak_lang_items.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00