// Do a search through a list of bounds, using a callback to actually
// create the candidates.
Do a search through a list of bounds, using a callback to actually
create the candidates.
Do a search through a list of bounds using a callback to actually create the candidates .
fn elaborate_bounds<F>(
        &mut self,
        bounds: &[ty::PolyTraitRef<'tcx>],
        mut mk_cand: F,
    ) where
        F: for<'b> FnMut(
            &mut ProbeContext<'b, 'tcx>,
            ty::PolyTraitRef<'tcx>,
            ty::ImplOrTraitItem<'tcx>,
        ),
    {
        debug!("elaborate_bounds(bounds={:?})", bounds);
        let tcx = self.tcx();
        for bound_trait_ref in traits::transitive_bounds(tcx, bounds) {
            let item = match trait_item(tcx,
                                        bound_trait_ref.def_id(),
                                        self.item_name) {
                Some(v) => v,
                None => { continue; }
            };
            if !self.has_applicable_self(&item) {
                self.record_static_candidate(TraitSource(bound_trait_ref.def_id()));
            } else {
                mk_cand(self, bound_trait_ref, item);
            }
        }
    }
fn elaborate_bounds < F > ( & mut self , bounds : & [ ty :: PolyTraitRef < ' tcx > ] , mut mk_cand : F , ) where F : for < ' b > FnMut ( & mut ProbeContext < ' b , ' tcx > , ty :: PolyTraitRef < ' tcx > , ty :: ImplOrTraitItem < ' tcx > , ) , { debug ! ( " " bounds ) ; let tcx = self . tcx ( ) ; for bound_trait_ref in traits :: transitive_bounds ( tcx , bounds ) { let item = match trait_item ( tcx , bound_trait_ref . def_id ( ) , self . item_name ) { Some ( v ) => v , None => { continue ; } } ; if ! self . has_applicable_self ( & item ) { self . record_static_candidate ( TraitSource ( bound_trait_ref . def_id ( ) ) ) ; } else { mk_cand ( self , bound_trait_ref , item ) ; } } }
Do a search through a list of bounds, using a callback to actually
create the candidates.
Do a search through a list of bounds using a callback to actually create the candidates .
&mut self
bounds
&[ty::PolyTraitRef<'tcx>]
mk_cand
F