pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Error>
        where P: ObligationProcessor<Obligation=O>
    {
        debug!("process_obligations(len={})", self.nodes.len());

        let mut errors = vec![];
        let mut stalled = true;

        for index in 0..self.nodes.len() {
            debug!("process_obligations: node {} == {:?}",
                   index,
                   self.nodes[index]);

            let result = match self.nodes[index] {
                Node { state: ref _state, ref mut obligation, .. }
                    if _state.get() == NodeState::Pending =>
                {
                    processor.process_obligation(obligation)
                }
                _ => continue
            };

            debug!("process_obligations: node {} got result {:?}",
                   index,
                   result);

            match result {
                ProcessResult::Unchanged => {
                    // No change in state.
                }
                ProcessResult::Changed(children) => {
                    // We are not (yet) stalled.
                    stalled = false;
                    self.nodes[index].state.set(NodeState::Success);

                    for child in children {
                        let st = self.register_obligation_at(
                            child,
                            Some(NodeIndex::new(index))
                        );
                        if let Err(()) = st {
                            // error already reported - propagate it
                            // to our node.
                            self.error_at(index);
                        }
                    }
                }
                ProcessResult::Error(err) => {
                    stalled = false;
                    let backtrace = self.error_at(index);
                    errors.push(Error {
                        error: err,
                        backtrace,
                    });
                }
            }
        }

        if stalled {
            // There's no need to perform marking, cycle processing and compression when nothing
            // changed.
            return Outcome {
                completed: vec![],
                errors,
                stalled,
            };
        }

        self.mark_as_waiting();
        self.process_cycles(processor);

        // Now we have to compress the result
        let completed_obligations = self.compress();

        debug!("process_obligations: complete");

        Outcome {
            completed: completed_obligations,
            errors,
            stalled,
        }
    }
/// Perform a pass through the obligation list. This must
/// be called in a loop until `outcome.stalled` is false.
///
/// This CANNOT be unrolled (presently, at least).
Perform a pass through the obligation list. This must
be called in a loop until `outcome.stalled` is false.

This CANNOT be unrolled (presently, at least).
Perform a pass through the obligation list . This must be called in a loop until ` outcome . stalled ` is false . This CANNOT be unrolled ( presently at least ) .
pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Error>
        where P: ObligationProcessor<Obligation=O>
    {
        debug!("process_obligations(len={})", self.nodes.len());
        let mut errors = vec![];
        let mut stalled = true;
        for index in 0..self.nodes.len() {
            debug!("process_obligations: node {} == {:?}",
                   index,
                   self.nodes[index]);
            let result = match self.nodes[index] {
                Node { state: ref _state, ref mut obligation, .. }
                    if _state.get() == NodeState::Pending =>
                {
                    processor.process_obligation(obligation)
                }
                _ => continue
            };
            debug!("process_obligations: node {} got result {:?}",
                   index,
                   result);
            match result {
                ProcessResult::Unchanged => {
                    // No change in state.
                }
                ProcessResult::Changed(children) => {
                    // We are not (yet) stalled.
                    stalled = false;
                    self.nodes[index].state.set(NodeState::Success);
                    for child in children {
                        let st = self.register_obligation_at(
                            child,
                            Some(NodeIndex::new(index))
                        );
                        if let Err(()) = st {
                            // error already reported - propagate it
                            // to our node.
                            self.error_at(index);
                        }
                    }
                }
                ProcessResult::Error(err) => {
                    stalled = false;
                    let backtrace = self.error_at(index);
                    errors.push(Error {
                        error: err,
                        backtrace,
                    });
                }
            }
        }
        if stalled {
            // There's no need to perform marking, cycle processing and compression when nothing
            // changed.
            return Outcome {
                completed: vec![],
                errors,
                stalled,
            };
        }
        self.mark_as_waiting();
        self.process_cycles(processor);
        // Now we have to compress the result
        let completed_obligations = self.compress();
        debug!("process_obligations: complete");
        Outcome {
            completed: completed_obligations,
            errors,
            stalled,
        }
    }
pub fn process_obligations < P > ( & mut self , processor : & mut P ) -> Outcome < O , P :: Error > where P : ObligationProcessor < Obligation = O > { debug ! ( " " self nodes len ( ) ) ; let mut errors = vec ! [ ] ; let mut stalled = true ; for index in 0 .. self . nodes . len ( ) { debug ! ( " " index self nodes [ index ] ) ; let result = match self . nodes [ index ] { Node { state : ref _state , ref mut obligation , .. } if _state . get ( ) == NodeState :: Pending => { processor . process_obligation ( obligation ) } _ => continue } ; debug ! ( " " index result ) ; match result { ProcessResult :: Unchanged => { // No change in state. } ProcessResult :: Changed ( children ) => { // We are not (yet) stalled. stalled = false ; self . nodes [ index ] . state . set ( NodeState :: Success ) ; for child in children { let st = self . register_obligation_at ( child , Some ( NodeIndex :: new ( index ) ) ) ; if let Err ( ( ) ) = st { // error already reported - propagate it // to our node. self . error_at ( index ) ; } } } ProcessResult :: Error ( err ) => { stalled = false ; let backtrace = self . error_at ( index ) ; errors . push ( Error { error : err , backtrace , } ) ; } } } if stalled { // There's no need to perform marking, cycle processing and compression when nothing // changed. return Outcome { completed : vec ! [ ] , errors , stalled , } ; } self . mark_as_waiting ( ) ; self . process_cycles ( processor ) ; // Now we have to compress the result let completed_obligations = self . compress ( ) ; debug ! ( " " ) ; Outcome { completed : completed_obligations , errors , stalled , } }
Perform a pass through the obligation list.
Perform a pass through the obligation list .
&mut self
processor
&mut P
&mut self
processor
&mut P