/// Ensure that either this query has all green inputs or been executed.
/// Executing query::ensure(D) is considered a read of the dep-node D.
///
/// This function is particularly useful when executing passes for their
/// side-effects -- e.g., in order to report errors for erroneous programs.
///
/// Note: The optimization is only available during incr. comp.
Ensure that either this query has all green inputs or been executed.
Executing query::ensure(D) is considered a read of the dep-node D.

This function is particularly useful when executing passes for their
side-effects -- e.g., in order to report errors for erroneous programs.

The optimization is only available during incr. comp.
Ensure that either this query has all green inputs or been executed . Executing query :: ensure ( D ) is considered a read of the dep - node D . This function is particularly useful when executing passes for their side - effects -- e . g . in order to report errors for erroneous programs . The optimization is only available during incr . comp .
pub(super) fn ensure_query<Q: QueryDescription<'gcx>>(self, key: Q::Key) -> () {
        let dep_node = Q::to_dep_node(self, &key);
        // Ensuring an "input" or anonymous query makes no sense
        assert!(!dep_node.kind.is_anon());
        assert!(!dep_node.kind.is_input());
        if self.try_mark_green_and_read(&dep_node).is_none() {
            // A None return from `try_mark_green_and_read` means that this is either
            // a new dep node or that the dep node has already been marked red.
            // Either way, we can't call `dep_graph.read()` as we don't have the
            // DepNodeIndex. We must invoke the query itself. The performance cost
            // this introduces should be negligible as we'll immediately hit the
            // in-memory cache, or another query down the line will.
            self.sess.profiler(|p| {
                p.start_activity(Q::CATEGORY);
                p.record_query(Q::CATEGORY);
            });
            let _ = self.get_query::<Q>(DUMMY_SP, key);
            self.sess.profiler(|p| p.end_activity(Q::CATEGORY));
        }
    }
pub ( super ) fn ensure_query < Q : QueryDescription < ' gcx > > ( self , key : Q :: Key ) -> ( ) { let dep_node = Q :: to_dep_node ( self , & key ) ; // Ensuring an "input" or anonymous query makes no sense assert ! ( dep_node kind is_anon ( ) ) ; assert ! ( dep_node kind is_input ( ) ) ; if self . try_mark_green_and_read ( & dep_node ) . is_none ( ) { // A None return from `try_mark_green_and_read` means that this is either // a new dep node or that the dep node has already been marked red. // Either way, we can't call `dep_graph.read()` as we don't have the // DepNodeIndex. We must invoke the query itself. The performance cost // this introduces should be negligible as we'll immediately hit the // in-memory cache, or another query down the line will. self . sess . profiler ( | p | { p . start_activity ( Q :: CATEGORY ) ; p . record_query ( Q :: CATEGORY ) ; } ) ; let _ = self . get_query :: < Q > ( DUMMY_SP , key ) ; self . sess . profiler ( | p | p . end_activity ( Q :: CATEGORY ) ) ; } }
Ensure that either this query has all green inputs or been executed.
Ensure that either this query has all green inputs or been executed .
self
key
Q::Key