pub fn populate_implementations_for_trait_if_necessary(self, trait_id: DefId) {
        if trait_id.is_local() {
            return
        }

        // The type is not local, hence we are reading this out of
        // metadata and don't need to track edges.
        let _ignore = self.dep_graph.in_ignore();

        let def = self.lookup_trait_def(trait_id);
        if def.flags.get().intersects(TraitFlags::IMPLS_VALID) {
            return;
        }

        debug!("populate_implementations_for_trait_if_necessary: searching for {:?}", def);

        if self.sess.cstore.is_defaulted_trait(trait_id) {
            self.record_trait_has_default_impl(trait_id);
        }

        for impl_def_id in self.sess.cstore.implementations_of_trait(Some(trait_id)) {
            let trait_ref = self.impl_trait_ref(impl_def_id).unwrap();

            // Record the trait->implementation mapping.
            let parent = self.sess.cstore.impl_parent(impl_def_id).unwrap_or(trait_id);
            def.record_remote_impl(self, impl_def_id, trait_ref, parent);
        }

        def.flags.set(def.flags.get() | TraitFlags::IMPLS_VALID);
    }
/// Populates the type context with all the implementations for the given
/// trait if necessary.
Populates the type context with all the implementations for the given
trait if necessary.
Populates the type context with all the implementations for the given trait if necessary .
pub fn populate_implementations_for_trait_if_necessary(self, trait_id: DefId) {
        if trait_id.is_local() {
            return
        }
        // The type is not local, hence we are reading this out of
        // metadata and don't need to track edges.
        let _ignore = self.dep_graph.in_ignore();
        let def = self.lookup_trait_def(trait_id);
        if def.flags.get().intersects(TraitFlags::IMPLS_VALID) {
            return;
        }
        debug!("populate_implementations_for_trait_if_necessary: searching for {:?}", def);
        if self.sess.cstore.is_defaulted_trait(trait_id) {
            self.record_trait_has_default_impl(trait_id);
        }
        for impl_def_id in self.sess.cstore.implementations_of_trait(Some(trait_id)) {
            let trait_ref = self.impl_trait_ref(impl_def_id).unwrap();
            // Record the trait->implementation mapping.
            let parent = self.sess.cstore.impl_parent(impl_def_id).unwrap_or(trait_id);
            def.record_remote_impl(self, impl_def_id, trait_ref, parent);
        }
        def.flags.set(def.flags.get() | TraitFlags::IMPLS_VALID);
    }
pub fn populate_implementations_for_trait_if_necessary ( self , trait_id : DefId ) { if trait_id . is_local ( ) { return } // The type is not local, hence we are reading this out of // metadata and don't need to track edges. let _ignore = self . dep_graph . in_ignore ( ) ; let def = self . lookup_trait_def ( trait_id ) ; if def . flags . get ( ) . intersects ( TraitFlags :: IMPLS_VALID ) { return ; } debug ! ( " " def ) ; if self . sess . cstore . is_defaulted_trait ( trait_id ) { self . record_trait_has_default_impl ( trait_id ) ; } for impl_def_id in self . sess . cstore . implementations_of_trait ( Some ( trait_id ) ) { let trait_ref = self . impl_trait_ref ( impl_def_id ) . unwrap ( ) ; // Record the trait->implementation mapping. let parent = self . sess . cstore . impl_parent ( impl_def_id ) . unwrap_or ( trait_id ) ; def . record_remote_impl ( self , impl_def_id , trait_ref , parent ) ; } def . flags . set ( def . flags . get ( ) | TraitFlags :: IMPLS_VALID ) ; }
Populates the type context with all the implementations for the given
trait if necessary.
Populates the type context with all the implementations for the given trait if necessary .
self
trait_id
DefId