rust/compiler/rustc_infer
bors 1b3fba066c Auto merge of #124203 - lukas-code:delete-deleting-caches, r=compiler-errors
fix normalizing in different `ParamEnv`s with the same `InferCtxt`

This PR changes the key of the projection cache from just `AliasTy` to `(AliasTy, ParamEnv)` to allow normalizing in different `ParamEnv`s without resetting caches. Previously, normalizing the same alias in different param envs would always reuse the cached result from the first normalization, which is incorrect if the projection clauses in the param env have changed.

Fixing this bug allows us to get rid of `InferCtxt::clear_caches`, which was only used by the `AutoTraitFinder`, because it requires normalizing in different param envs.

r? `@fmease`
2024-04-21 19:05:08 +00:00
..
src Auto merge of #124203 - lukas-code:delete-deleting-caches, r=compiler-errors 2024-04-21 19:05:08 +00:00
Cargo.toml Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
messages.ftl Use fn ptr signature instead of {closure@..} in infer error 2024-04-10 00:41:27 +00:00