]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obk
authorYuki Okushi <huyuumi.dev@gmail.com>
Mon, 20 Jan 2020 22:32:44 +0000 (07:32 +0900)
committerGitHub <noreply@github.com>
Mon, 20 Jan 2020 22:32:44 +0000 (07:32 +0900)
commitbff216c56f472dd751d3da636027d5e2d821e979
tree30cb8a64c2af31dbde2872e90a39e934aa6c16db
parenteff6381c32c23b094152ad8a7f63f4e617014fd0
parent3fef3d8b76e70da88366e45a62f98592cf9be76c
Rollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obk

 Filter and test predicates using `normalize_and_test_predicates` for const-prop

Fixes #68264

Previously, I attempted to use
`substitute_normalize_and_test_predicates` to detect unsatisfiable
bounds. Unfortunately, since const-prop runs in a generic environment
(we don't have any of the function's generic parameters substituted),
this could lead to cycle errors when attempting to normalize predicates.

This check is replaced with a more precise check. We now only call
`normalize_and_test_predicates` on predicates that have the possibility
of being proved unsatisfiable - that is, predicates that don't depend
on anything local to the function (e.g. generic parameters). This
ensures that we don't hit cycle errors when we normalize said
predicates, while still ensuring that we detect unsatisfiable
predicates.

I haven't been able to come up with a minimization of the Diesel issue - however, I've verified that it compiles successfully.
src/librustc/query/mod.rs
src/librustc/traits/mod.rs
src/librustc_mir/transform/const_prop.rs