Skip to content

Commit

Permalink
Document elaborate_trait_refs_that_define_assoc_type
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Nov 27, 2020
1 parent a175f36 commit 9e0538b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_infer/src/traits/util.rs
Expand Up @@ -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>>,
Expand Down

0 comments on commit 9e0538b

Please sign in to comment.