find_cycle in rustc_query_impl::job - Rust
Description: 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.

Skip to main content

## find_cycle

# Function find_cycle

Source

    fn find_cycle<'tcx>(
        job_map: &QueryJobMap<'tcx>,
        query: QueryJobId,
        span: Span,
        stack: &mut Vec<(Span, QueryJobId)>,
        visited: &mut FxHashSet<QueryJobId>,
    ) -> ControlFlow<Option<(QueryJobId, usize)>>

Expand description

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.