about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2021-07-04 11:26:32 -0400
committerNiko Matsakis <niko@alum.mit.edu>2021-07-04 11:28:20 -0400
commit40ee019c17dc35a1681d48246b8cdd3d6563702f (patch)
treeb5e9795febaff40ffd5ab83439c2fcecc44ca655 /compiler/rustc_middle/src/query
parent26f7030b16716712070d04ad938e9762b8756f7f (diff)
downloadrust-40ee019c17dc35a1681d48246b8cdd3d6563702f.tar.gz
rust-40ee019c17dc35a1681d48246b8cdd3d6563702f.zip
allow inference vars in type_implements_trait
Diffstat (limited to 'compiler/rustc_middle/src/query')
-rw-r--r--compiler/rustc_middle/src/query/mod.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 23ee0e05062..0986a465729 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1559,9 +1559,22 @@ rustc_queries! {
         desc { "evaluating trait selection obligation `{}`", goal.value }
     }
 
+    /// Evaluates whether the given type implements the given trait
+    /// in the given environment.
+    ///
+    /// The inputs are:
+    ///
+    /// - the def-id of the trait
+    /// - the self type
+    /// - the *other* type parameters of the trait, excluding the self-type
+    /// - the parameter environment
+    ///
+    /// FIXME. If the type, trait, or environment has inference variables,
+    /// this yields `EvaluatedToUnknown`. It should be refactored
+    /// to use canonicalization, really.
     query type_implements_trait(
         key: (DefId, Ty<'tcx>, SubstsRef<'tcx>, ty::ParamEnv<'tcx>, )
-    ) -> bool {
+    ) -> traits::EvaluationResult {
         desc { "evaluating `type_implements_trait` `{:?}`", key }
     }