rust/compiler/rustc_query_system
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
..
src Auto merge of #138824 - Zoxc:dep-graph-no-prev-map, r=oli-obk 2025-03-26 17:36:52 +00:00
Cargo.toml Use hashbrown from crates.io 2025-03-21 07:54:35 +01:00
messages.ftl improve diagnostics for const eval query overflow 2025-01-06 09:43:05 +01:00