Document elaborate_trait_refs_that_define_assoc_type

This commit is contained in:
Santiago Pastorino 2020-11-24 16:59:57 -03:00
parent a175f36c95
commit 9e0538bd07
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -90,6 +90,11 @@ pub fn elaborate_trait_refs<'tcx>(
elaborate_predicates(tcx, predicates)
}
/// A specialized variant of `elaborate_trait_refs` that only elaborates trait references that may
/// define the given associated type `assoc_name`. It uses the
/// `super_predicates_that_define_assoc_type` query to avoid enumerating super-predicates that
/// aren't related to `assoc_item`. This is used when resolving types like `Self::Item` or
/// `T::Item` and helps to avoid cycle errors (see e.g. #35237).
pub fn elaborate_trait_refs_that_define_assoc_type<'tcx>(
tcx: TyCtxt<'tcx>,
trait_refs: impl Iterator<Item = ty::PolyTraitRef<'tcx>>,