Skip to main content

Module job

Module job 

Source

Re-exportsΒ§

use std::io::Write; πŸ”’
use std::ops::ControlFlow; πŸ”’
use std::sync::Arc; πŸ”’
use std::iter; πŸ”’
use std::mem; πŸ”’
use rustc_data_structures::fx::FxHashMap; πŸ”’
use rustc_data_structures::fx::FxHashSet; πŸ”’
use rustc_data_structures::hash_table::HashTable; πŸ”’
use rustc_data_structures::sync::DynSend; πŸ”’
use rustc_data_structures::sync::DynSync; πŸ”’
use rustc_middle::queries::TaggedQueryKey; πŸ”’
use rustc_middle::query::ActiveKeyStatus; πŸ”’
use rustc_middle::query::QueryCache; πŸ”’
use rustc_middle::query::QueryCycle; πŸ”’
use rustc_middle::query::QueryJob; πŸ”’
use rustc_middle::query::QueryJobId; πŸ”’
use rustc_middle::query::QueryKey; πŸ”’
use rustc_middle::query::QueryLatch; πŸ”’
use rustc_middle::query::QueryStackFrame; πŸ”’
use rustc_middle::query::QueryVTable; πŸ”’
use rustc_middle::query::QueryWaiter; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_span::DUMMY_SP; πŸ”’
use rustc_span::Span; πŸ”’
use tracing::debug; πŸ”’
use crate::query_vtables::for_each_query_vtable; πŸ”’

StructsΒ§

AbstractedWaiter πŸ”’
This abstracts over non-resumable waiters which are found in QueryJob’s parent field and resumable waiters are in latch field.
QueryJobInfo πŸ”’
QueryJobMap
Map from query job IDs to job information collected by collect_active_query_jobs.

EnumsΒ§

CollectActiveJobsKind

FunctionsΒ§

abstracted_waiters_of πŸ”’
Returns all the non-resumable and resumable waiters of a query. This is used so we can uniformly loop over both non-resumable and resumable waiters.
break_query_cycle
Detects query cycles by using depth first search over all active query jobs. If a query cycle is found it will break the cycle by finding an edge which uses a query latch and then resuming that waiter.
collect_active_query_jobs
Returns a map of currently active query jobs, collected from all queries.
collect_active_query_jobs_inner πŸ”’
Internal plumbing for collecting the set of active jobs for this query.
connected_to_root πŸ”’
Finds out if there’s a path to the compiler root (aka. code which isn’t in a query) from query without going through any of the queries in visited. This is achieved with a depth first search.
find_and_process_cycle πŸ”’
Looks for a query cycle starting at query. Returns a waiter to resume if a cycle is found.
find_cycle πŸ”’
Looks for a query cycle by doing a depth first search starting at query. span is the reason for the query to execute. This is initially DUMMY_SP. If a cycle is detected, this initial value is replaced with the span causing the cycle. stack will contain just the cycle on return if detected.
find_cycle_in_stack πŸ”’
find_dep_kind_root πŸ”’
Finds the query job closest to the root that is for the same query method as id (but not necessarily the same query key), and returns information about it.
print_query_stack
process_cycle πŸ”’
Processes a found query cycle into a Cycle

Type AliasesΒ§

ResumableWaiterLocation πŸ”’
The locaton of a resumable waiter. The usize is the index into waiters in the query’s latch. We’ll use this to remove the waiter if we’re waking it up in find_and_process_cycle.