fn pop_task(&mut self, opt_name: Option<N>) -> DepNodeIndex {
        let entry = self.task_stack.pop().unwrap();

        // Canonicalize the vector of predecessors.
        let predecessors = if let Some(s) = self.predecessors.get(&entry.predecessors).cloned() {
            s
        } else {
            let vec = Rc::new(entry.predecessors);
            self.predecessors.insert(vec.clone());
            vec
        };

        // Check if a suitable anonymous node already exists.
        //
        // Micro-optimization: this could be improved by taking
        // advantage of the fact that vectors of predecessors are
        // interned above.
        if opt_name.is_none() {
            if let Some(&index) = self.anon_node_map.get(&predecessors) {
                return index;
            }
        }

        // Otherwise, we have to make a new node. If this is a named node,
        // it should not already exist.
        let index = DepNodeIndex { index: self.node_data.len() };
        if let Some(ref n) = opt_name {
            let prev = self.named_node_map.insert(n.clone(), index);
            assert!(prev.is_none(), "created named node {:?} twice", n);
        }
        self.node_data.push(DepNodeData { opt_name, predecessors });

        index
    }
/// Finishes the current task and creates a node to represent it.
/// The node will be anonymous if `opt_name` is `None`, and named
/// otherwise.
Finishes the current task and creates a node to represent it.
The node will be anonymous if `opt_name` is `None`, and named
otherwise.
Finishes the current task and creates a node to represent it . The node will be anonymous if ` opt_name ` is ` None ` and named otherwise .
fn pop_task(&mut self, opt_name: Option<N>) -> DepNodeIndex {
        let entry = self.task_stack.pop().unwrap();
        // Canonicalize the vector of predecessors.
        let predecessors = if let Some(s) = self.predecessors.get(&entry.predecessors).cloned() {
            s
        } else {
            let vec = Rc::new(entry.predecessors);
            self.predecessors.insert(vec.clone());
            vec
        };
        // Check if a suitable anonymous node already exists.
        //
        // Micro-optimization: this could be improved by taking
        // advantage of the fact that vectors of predecessors are
        // interned above.
        if opt_name.is_none() {
            if let Some(&index) = self.anon_node_map.get(&predecessors) {
                return index;
            }
        }
        // Otherwise, we have to make a new node. If this is a named node,
        // it should not already exist.
        let index = DepNodeIndex { index: self.node_data.len() };
        if let Some(ref n) = opt_name {
            let prev = self.named_node_map.insert(n.clone(), index);
            assert!(prev.is_none(), "created named node {:?} twice", n);
        }
        self.node_data.push(DepNodeData { opt_name, predecessors });
        index
    }
fn pop_task ( & mut self , opt_name : Option < N > ) -> DepNodeIndex { let entry = self . task_stack . pop ( ) . unwrap ( ) ; // Canonicalize the vector of predecessors. let predecessors = if let Some ( s ) = self . predecessors . get ( & entry . predecessors ) . cloned ( ) { s } else { let vec = Rc :: new ( entry . predecessors ) ; self . predecessors . insert ( vec . clone ( ) ) ; vec } ; // Check if a suitable anonymous node already exists. // // Micro-optimization: this could be improved by taking // advantage of the fact that vectors of predecessors are // interned above. if opt_name . is_none ( ) { if let Some ( & index ) = self . anon_node_map . get ( & predecessors ) { return index ; } } // Otherwise, we have to make a new node. If this is a named node, // it should not already exist. let index = DepNodeIndex { index : self . node_data . len ( ) } ; if let Some ( ref n ) = opt_name { let prev = self . named_node_map . insert ( n . clone ( ) , index ) ; assert ! ( prev is_none ( ) " " n ) ; } self . node_data . push ( DepNodeData { opt_name , predecessors } ) ; index }
Finishes the current task and creates a node to represent it.
Finishes the current task and creates a node to represent it .
&mut self
opt_name
Option<N>
&mut self
opt_name
Option<N>