about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2020-07-23 21:59:20 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2020-10-06 11:19:31 +0100
commitcfee49593d756bb97018d1d2ac194e0821d2dfca (patch)
tree6b93b9dc025cbf3275b384cc52fcd39d250ad3dd /compiler/rustc_middle
parentbc08b791bce1c5b31052da5dfda74302b6f61a99 (diff)
downloadrust-cfee49593d756bb97018d1d2ac194e0821d2dfca.tar.gz
rust-cfee49593d756bb97018d1d2ac194e0821d2dfca.zip
Handle multiple applicable projection candidates
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/query/mod.rs2
-rw-r--r--compiler/rustc_middle/src/traits/select.rs7
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 240f2c0792c..fc4c343372a 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -157,7 +157,7 @@ rustc_queries! {
         }
 
         /// Returns the list of bounds that can be used for
-        /// `SelectionCandidate::ProjectionCandidate` and
+        /// `SelectionCandidate::ProjectionCandidate(_)` and
         /// `ProjectionTyCandidate::TraitDef`.
         /// Specifically this is the bounds written on the trait's type
         /// definition, or those after the `impl` keyword
diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs
index 6ad514c6be2..358ead507b4 100644
--- a/compiler/rustc_middle/src/traits/select.rs
+++ b/compiler/rustc_middle/src/traits/select.rs
@@ -105,9 +105,10 @@ pub enum SelectionCandidate<'tcx> {
     ImplCandidate(DefId),
     AutoImplCandidate(DefId),
 
-    /// This is a trait matching with a projected type as `Self`, and
-    /// we found an applicable bound in the trait definition.
-    ProjectionCandidate,
+    /// This is a trait matching with a projected type as `Self`, and we found
+    /// an applicable bound in the trait definition. The `usize` is an index
+    /// into the list returned by `tcx.item_bounds`.
+    ProjectionCandidate(usize),
 
     /// Implementation of a `Fn`-family trait by one of the anonymous types
     /// generated for a `||` expression.