about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-02 21:26:59 +0000
committerbors <bors@rust-lang.org>2021-09-02 21:26:59 +0000
commit371f3cd3fe523d0b398ed1db1620667c53ba7d02 (patch)
treec3b9bfb650f0c790ac65aa9832ea738ab235f5c8 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentb834c4c1bad7521af47f38f44a4048be0a1fe2ee (diff)
parent611191f54c563587a9130b8cb4afba1856aebebc (diff)
downloadrust-371f3cd3fe523d0b398ed1db1620667c53ba7d02.tar.gz
rust-371f3cd3fe523d0b398ed1db1620667c53ba7d02.zip
Auto merge of #85868 - Aaron1011:projection-cache, r=jackh726
Preserve most sub-obligations in the projection cache

Fixes https://github.com/rust-lang/rust/issues/85360

When we evaluate a projection predicate, we may produce sub-obligations. During trait evaluation, evaluating these sub-obligations might cause us to produce `EvaluatedToOkModuloRegions`.

When we cache the result of projection in our projection cache, we try to throw away some of the sub-obligations, so that we don't need to re-evaluate/process them the next time we need to perform this particular projection. However, we may end up throwing away predicates that will (recursively) evaluate to `EvaluatedToOkModuloRegions`. If we do, then the result of evaluating a predicate will depend on the state of the predicate cache - this is global untracked state, which interacts badly with incremental compilation.

To fix this, we now only discard global predicates that evaluate to `EvaluatedToOk`. This ensures that any predicates that (may) evaluate to `EvaluatedToOkModuloRegions` are kept in the cache, and influence the results of any queries which perform this projection.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions