rust/compiler/rustc_query_system/src
bors a2e63569fd Auto merge of #138824 - Zoxc:dep-graph-no-prev-map, r=oli-obk
Remove `prev_index_to_index` field from `CurrentDepGraph`

The dep graph currently has 2 ways to map a previous index into a current index. The `prev_index_to_index` map stores the current index equivalent of a previous index. For indices which are marked green, we also store the same information in the `DepNodeColorMap`. We actually only need to known the mapping for green nodes however, so this PR removes `prev_index_to_index` and instead makes use of the `DepNodeColorMap`.

To avoid racing when promoting a node from the previous session, the encoder lock is now used to ensure only one thread encodes the promoted node. This was previously done by the lock in `prev_index_to_index`.

This also changes `nodes_newly_allocated_in_current_session` used to detect duplicate dep nodes to contain both new and previous nodes, which is simpler and can better catch duplicates.

The dep node index encoding used in `DepNodeColorMap` is tweak to avoid subtraction / addition to optimize accessing the current equivalent of a previous index.

r? `@oli-obk`
2025-03-26 17:36:52 +00:00
..
dep_graph Remove prev_index_to_index field from CurrentDepGraph 2025-03-24 19:58:34 +01:00
ich Introduce new parsing infrastructure and types for parsed attributes 2025-02-24 14:26:06 +01:00
query Rollup merge of #138874 - Zoxc:waiter-race, r=SparrowLii,davidtwco 2025-03-25 20:34:46 -04:00
cache.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
error.rs don't return an Option from try_find_dep_kind 2025-01-07 21:57:00 +01:00
lib.rs Use hashbrown from crates.io 2025-03-21 07:54:35 +01:00
values.rs Value recovery can take the whole CycleError 2024-01-08 20:30:10 +00:00