From ac1845a6f053d5b1294c13cfb7be202105c34198 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 24 Nov 2020 17:04:44 -0300 Subject: [PATCH] Fix super_predicates_that_define_assoc_type API doc --- compiler/rustc_middle/src/query/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index d7718dea437..925a05c879b 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -442,12 +442,10 @@ rustc_queries! { desc { |tcx| "computing the super traits of `{}`", tcx.def_path_str(key) } } - /// Maps from the `DefId` of a trait to the list of - /// super-predicates. This is a subset of the full list of - /// predicates. We store these in a separate map because we must - /// evaluate them even during type conversion, often before the - /// full predicates are available (note that supertraits have - /// additional acyclicity requirements). + /// The `Option` is the name of an associated type. If it is `None`, then this query + /// returns the full set of predicates. If `Some`, then the query returns only the + /// subset of super-predicates that reference traits that define the given associated type. + /// This is used to avoid cycles in resolving types like `T::Item`. query super_predicates_that_define_assoc_type(key: (DefId, Option)) -> ty::GenericPredicates<'tcx> { desc { |tcx| "computing the super traits of `{}`{}", tcx.def_path_str(key.0),