]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #68475 - Aaron1011:fix/forest-caching, r=nikomatsakis
authorYuki Okushi <huyuumi.dev@gmail.com>
Fri, 14 Feb 2020 22:17:45 +0000 (07:17 +0900)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 22:17:45 +0000 (07:17 +0900)
commit2c5bdee9e4a750355c99a1fbed57b20ba953766b
treea59ab484d0c2676f98df5824c2a63d2ff6acb51f
parent3f7ed88fdc99e7b8e6a112df7b63d5caf81bb6c0
parent90afc0765e5e536af6307b63e1655a38df06e235
Rollup merge of #68475 - Aaron1011:fix/forest-caching, r=nikomatsakis

Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest`

Previously, we used a plain `Predicate` to cache results (e.g. successes
and failures) in ObligationForest. However, fulfillment depends on the
precise `ParamEnv` used, so this is unsound in general.

This commit changes the impl of `ForestObligation` for
`PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of
`Predicate` for the associated type. The associated type and method are
renamed from 'predicate' to 'cache_key' to reflect the fact that type is
no longer just a predicate.
src/librustc_data_structures/obligation_forest/graphviz.rs
src/librustc_data_structures/obligation_forest/mod.rs