about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-26 17:36:52 +0000
committerbors <bors@rust-lang.org>2025-03-26 17:36:52 +0000
commita2e63569fd6702ac5dd027a80a9fdaadce73adae (patch)
tree9159ce63c28c9612318ba5f909f8f653bb62607d /compiler/rustc_mir_transform/src/errors.rs
parent19cab6b878ab18dce4816d85ac52b317214c485f (diff)
parent60e4a1b8f37c48cfc4c8c78aaafc5ff2f8d02ca1 (diff)
downloadrust-a2e63569fd6702ac5dd027a80a9fdaadce73adae.tar.gz
rust-a2e63569fd6702ac5dd027a80a9fdaadce73adae.zip
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`
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions