about summary refs log tree commit diff
path: root/src/librustc/query/mod.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-15 21:51:43 +0900
committerGitHub <noreply@github.com>2020-01-15 21:51:43 +0900
commit89b065dbd2b953ea3ae15ebfb67a799e8b0a3ecc (patch)
treeb64b104fcd7356a07d2e43c431389c559d1921d8 /src/librustc/query/mod.rs
parente800fe199cbfbbaa46dfa519e46b594512c068be (diff)
parente390b91e5717a338db20360a1ddffa23ba66701d (diff)
downloadrust-89b065dbd2b953ea3ae15ebfb67a799e8b0a3ecc.tar.gz
rust-89b065dbd2b953ea3ae15ebfb67a799e8b0a3ecc.zip
Rollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk
Don't run const propagation on items with inconsistent bounds

Fixes #67696

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.
Diffstat (limited to 'src/librustc/query/mod.rs')
-rw-r--r--src/librustc/query/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs
index f4c262fbac1..a20e011b91a 100644
--- a/src/librustc/query/mod.rs
+++ b/src/librustc/query/mod.rs
@@ -1148,11 +1148,11 @@ rustc_queries! {
             desc { "normalizing `{:?}`", goal }
         }
 
-        query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>)) -> bool {
+        query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>, traits::TraitQueryMode)) -> bool {
             no_force
             desc { |tcx|
-                "testing substituted normalized predicates:`{}`",
-                tcx.def_path_str(key.0)
+                "testing substituted normalized predicates in mode {:?}:`{}`",
+                key.2, tcx.def_path_str(key.0)
             }
         }