fn candidate_from_obligation<'o>(&mut self,
                                     stack: &ObligationStack<'o, 'tcx>)
                                     -> SelectionResult<'tcx, Candidate<'tcx>>
    {
        // Watch out for overflow. This intentionally bypasses (and does
        // not update) the cache.
        let recursion_limit = self.infcx.tcx.sess.recursion_limit.get();
        if stack.obligation.recursion_depth >= recursion_limit {
            debug!("{} --> overflow (limit={})",
                   stack.obligation.repr(self.tcx()),
                   recursion_limit);
            return Err(Overflow)
        }

        // Check the cache. Note that we skolemize the trait-ref
        // separately rather than using `stack.skol_trait_ref` -- this
        // is because we want the unbound variables to be replaced
        // with fresh skolemized types starting from index 0.
        let cache_skol_trait_ref =
            self.infcx.skolemize(stack.obligation.trait_ref.clone());
        debug!("candidate_from_obligation(cache_skol_trait_ref={}, obligation={})",
               cache_skol_trait_ref.repr(self.tcx()),
               stack.repr(self.tcx()));
        assert!(!stack.obligation.trait_ref.has_escaping_regions());

        match self.check_candidate_cache(cache_skol_trait_ref.clone()) {
            Some(c) => {
                debug!("CACHE HIT: cache_skol_trait_ref={}, candidate={}",
                       cache_skol_trait_ref.repr(self.tcx()),
                       c.repr(self.tcx()));
                return c;
            }
            None => { }
        }

        // If no match, compute result and insert into cache.
        let candidate = self.candidate_from_obligation_no_cache(stack);
        debug!("CACHE MISS: cache_skol_trait_ref={}, candidate={}",
               cache_skol_trait_ref.repr(self.tcx()), candidate.repr(self.tcx()));
        self.insert_candidate_cache(cache_skol_trait_ref, candidate.clone());
        candidate
    }
///////////////////////////////////////////////////////////////////////////
// CANDIDATE ASSEMBLY
//
// The selection process begins by examining all in-scope impls,
// caller obligations, and so forth and assembling a list of
// candidates. See `doc.rs` and the `Candidate` type for more details.
CANDIDATE ASSEMBLY
The selection process begins by examining all in-scope impls,
caller obligations, and so forth and assembling a list of
candidates. See `doc.rs` and the `Candidate` type for more details.
CANDIDATE ASSEMBLY The selection process begins by examining all in - scope impls caller obligations and so forth and assembling a list of candidates . See ` doc . rs ` and the ` Candidate ` type for more details .
fn candidate_from_obligation<'o>(&mut self,
                                     stack: &ObligationStack<'o, 'tcx>)
                                     -> SelectionResult<'tcx, Candidate<'tcx>>
    {
        // Watch out for overflow. This intentionally bypasses (and does
        // not update) the cache.
        let recursion_limit = self.infcx.tcx.sess.recursion_limit.get();
        if stack.obligation.recursion_depth >= recursion_limit {
            debug!("{} --> overflow (limit={})",
                   stack.obligation.repr(self.tcx()),
                   recursion_limit);
            return Err(Overflow)
        }
        // Check the cache. Note that we skolemize the trait-ref
        // separately rather than using `stack.skol_trait_ref` -- this
        // is because we want the unbound variables to be replaced
        // with fresh skolemized types starting from index 0.
        let cache_skol_trait_ref =
            self.infcx.skolemize(stack.obligation.trait_ref.clone());
        debug!("candidate_from_obligation(cache_skol_trait_ref={}, obligation={})",
               cache_skol_trait_ref.repr(self.tcx()),
               stack.repr(self.tcx()));
        assert!(!stack.obligation.trait_ref.has_escaping_regions());
        match self.check_candidate_cache(cache_skol_trait_ref.clone()) {
            Some(c) => {
                debug!("CACHE HIT: cache_skol_trait_ref={}, candidate={}",
                       cache_skol_trait_ref.repr(self.tcx()),
                       c.repr(self.tcx()));
                return c;
            }
            None => { }
        }
        // If no match, compute result and insert into cache.
        let candidate = self.candidate_from_obligation_no_cache(stack);
        debug!("CACHE MISS: cache_skol_trait_ref={}, candidate={}",
               cache_skol_trait_ref.repr(self.tcx()), candidate.repr(self.tcx()));
        self.insert_candidate_cache(cache_skol_trait_ref, candidate.clone());
        candidate
    }
fn candidate_from_obligation < ' o > ( & mut self , stack : & ObligationStack < ' o , ' tcx > ) -> SelectionResult < ' tcx , Candidate < ' tcx > > { // Watch out for overflow. This intentionally bypasses (and does // not update) the cache. let recursion_limit = self . infcx . tcx . sess . recursion_limit . get ( ) ; if stack . obligation . recursion_depth >= recursion_limit { debug ! ( " " stack obligation repr ( self tcx ( ) ) recursion_limit ) ; return Err ( Overflow ) } // Check the cache. Note that we skolemize the trait-ref // separately rather than using `stack.skol_trait_ref` -- this // is because we want the unbound variables to be replaced // with fresh skolemized types starting from index 0. let cache_skol_trait_ref = self . infcx . skolemize ( stack . obligation . trait_ref . clone ( ) ) ; debug ! ( " " cache_skol_trait_ref repr ( self tcx ( ) ) stack repr ( self tcx ( ) ) ) ; assert ! ( stack obligation trait_ref has_escaping_regions ( ) ) ; match self . check_candidate_cache ( cache_skol_trait_ref . clone ( ) ) { Some ( c ) => { debug ! ( " " cache_skol_trait_ref repr ( self tcx ( ) ) c repr ( self tcx ( ) ) ) ; return c ; } None => { } } // If no match, compute result and insert into cache. let candidate = self . candidate_from_obligation_no_cache ( stack ) ; debug ! ( " " cache_skol_trait_ref repr ( self tcx ( ) ) candidate repr ( self tcx ( ) ) ) ; self . insert_candidate_cache ( cache_skol_trait_ref , candidate . clone ( ) ) ; candidate }
CANDIDATE ASSEMBLY
The selection process begins by examining all in-scope impls,
caller obligations, and so forth and assembling a list of
candidates.
CANDIDATE ASSEMBLY The selection process begins by examining all in - scope impls caller obligations and so forth and assembling a list of candidates .
&mut self
stack
&ObligationStack<'o, 'tcx>