[parallel-queries] DepGraph::previous_work_products could be made immutable to avoid shared mutable state (original) (raw)

DepGraph::previous_work_products is a field in the dep-graph that contains the list of object files cached during the previous compilation session. In theory, this information is available already at the time when we load the previous dep-graph and thus the field could be made immutable (i.e. not use an RwLock) and be initialized at DepGraph construction time.

Refactoring this would need the following steps:

cc @rust-lang/wg-compiler-performance