rustc_trait_selection::traits

Function transitive_bounds_that_define_assoc_item

source
pub fn transitive_bounds_that_define_assoc_item<'tcx>(
    tcx: TyCtxt<'tcx>,
    trait_refs: impl Iterator<Item = Binder<TyCtxt<'tcx>, TraitRef<TyCtxt<'tcx>>>>,
    assoc_name: Ident,
) -> impl Iterator<Item = Binder<TyCtxt<'tcx>, TraitRef<TyCtxt<'tcx>>>>
Expand description

A specialized variant of elaborate that only elaborates trait references that may define the given associated item with the name assoc_name. It uses the explicit_supertraits_containing_assoc_item 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).