Before

…lines 1–121 unchanged (121 lines)
122
123#[cold]
124#[inline(never)]
125fn mk_cycle<'tcx, C: QueryCache>(
126 query: &'tcx QueryVTable<'tcx, C>,
127 tcx: TyCtxt<'tcx>,
128 cycle_error: CycleError,
129) -> C::Value {
130 let error = report_cycle(tcx.sess, &cycle_error);
131 match query.cycle_error_handling {
132 CycleErrorHandling::Error => {
133 let guar = error.emit();
134 (query.value_from_cycle_error)(tcx, cycle_error, guar)
135 }
136 CycleErrorHandling::DelayBug => {
137 let guar = error.delay_as_bug();
138 (query.value_from_cycle_error)(tcx, cycle_error, guar)
139 }
140 }
141}
142
143/// Guard object representing the responsibility to execute a query job and
144/// mark it as completed.
…lines 145–215 unchanged (71 lines)
216
217#[cold]
218#[inline(never)]
219fn cycle_error<'tcx, C: QueryCache>(
220 query: &'tcx QueryVTable<'tcx, C>,
221 tcx: TyCtxt<'tcx>,
222 try_execute: QueryJobId,
223 span: Span,
224) -> (C::Value, Option<DepNodeIndex>) {
225 // Ensure there was no errors collecting all active jobs.
226 // We need the complete map to ensure we find a cycle to break.
227 let job_map = collect_active_jobs_from_all_queries(tcx, false)
228 .ok()
229 .expect("failed to collect active queries");
230
231 let error = find_cycle_in_stack(try_execute, job_map, &current_query_job(), span);
232 (mk_cycle(query, tcx, error.lift()), None)
233}
234
235#[inline(always)]
236fn wait_for_query<'tcx, C: QueryCache>(
237 query: &'tcx QueryVTable<'tcx, C>,
238 tcx: TyCtxt<'tcx>,
…lines 239–270 unchanged (32 lines)
271
272 tcx.prof.query_cache_hit(index.into());
273 query_blocked_prof_timer.finish_with_query_invocation_id(index.into());
274
275 (v, Some(index))
276 }
277 Err(cycle) => (mk_cycle(query, tcx, cycle.lift()), None),
278 }
279}
280
281/// Shared main part of both [`execute_query_incr_inner`] and [`execute_query_non_incr_inner`].
282#[inline(never)]
283fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(
…lines 284–333 unchanged (50 lines)
334 } else {
335 let id = job.id;
336 drop(state_lock);
337
338 // If we are single-threaded we know that we have cycle error,
339 // so we just return the error.
340 cycle_error(query, tcx, id, span)
341 }
342 }
343 ActiveKeyStatus::Poisoned => FatalError.raise(),
344 }
345 }
346 }
…lines 347–738 unchanged (392 lines)

After

…lines 1–121 unchanged (121 lines)
122
123#[cold]
124#[inline(never)]
125fn mk_cycle<'tcx, C: QueryCache>(
126 query: &'tcx QueryVTable<'tcx, C>,
127 tcx: TyCtxt<'tcx>,
128 key: C::Key,
129 cycle_error: CycleError,
130) -> C::Value {
131 let error = report_cycle(tcx.sess, &cycle_error);
132 match query.cycle_error_handling {
133 CycleErrorHandling::Error => {
134 let guar = error.emit();
135 (query.value_from_cycle_error)(tcx, key, cycle_error, guar)
136 }
137 CycleErrorHandling::DelayBug => {
138 let guar = error.delay_as_bug();
139 (query.value_from_cycle_error)(tcx, key, cycle_error, guar)
140 }
141 }
142}
143
144/// Guard object representing the responsibility to execute a query job and
145/// mark it as completed.
…lines 146–216 unchanged (71 lines)
217
218#[cold]
219#[inline(never)]
220fn cycle_error<'tcx, C: QueryCache>(
221 query: &'tcx QueryVTable<'tcx, C>,
222 tcx: TyCtxt<'tcx>,
223 key: C::Key,
224 try_execute: QueryJobId,
225 span: Span,
226) -> (C::Value, Option<DepNodeIndex>) {
227 // Ensure there was no errors collecting all active jobs.
228 // We need the complete map to ensure we find a cycle to break.
229 let job_map = collect_active_jobs_from_all_queries(tcx, false)
230 .ok()
231 .expect("failed to collect active queries");
232
233 let error = find_cycle_in_stack(try_execute, job_map, &current_query_job(), span);
234 (mk_cycle(query, tcx, key, error.lift()), None)
235}
236
237#[inline(always)]
238fn wait_for_query<'tcx, C: QueryCache>(
239 query: &'tcx QueryVTable<'tcx, C>,
240 tcx: TyCtxt<'tcx>,
…lines 241–272 unchanged (32 lines)
273
274 tcx.prof.query_cache_hit(index.into());
275 query_blocked_prof_timer.finish_with_query_invocation_id(index.into());
276
277 (v, Some(index))
278 }
279 Err(cycle) => (mk_cycle(query, tcx, key, cycle.lift()), None),
280 }
281}
282
283/// Shared main part of both [`execute_query_incr_inner`] and [`execute_query_non_incr_inner`].
284#[inline(never)]
285fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(
…lines 286–335 unchanged (50 lines)
336 } else {
337 let id = job.id;
338 drop(state_lock);
339
340 // If we are single-threaded we know that we have cycle error,
341 // so we just return the error.
342 cycle_error(query, tcx, key, id, span)
343 }
344 }
345 ActiveKeyStatus::Poisoned => FatalError.raise(),
346 }
347 }
348 }
…lines 349–740 unchanged (392 lines)

Before

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "hash"
:: "::"
identifier "Hash"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "mem"
:: "::"
identifier "ManuallyDrop"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "hash_table"
:: "::"
use_list
{ "{"
identifier "Entry"
, ","
identifier "HashTable"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "stack"
:: "::"
identifier "ensure_sufficient_stack"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "sync"
:: "::"
use_list
{ "{"
identifier "DynSend"
, ","
identifier "DynSync"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_data_structures"
:: "::"
use_list
{ "{"
identifier "outline"
, ","
identifier "sharded"
, ","
identifier "sync"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_errors"
:: "::"
identifier "FatalError"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "dep_graph"
:: "::"
use_list
{ "{"
identifier "DepGraphData"
, ","
identifier "DepNodeKey"
, ","
identifier "SerializedDepNodeIndex"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "query"
:: "::"
identifier "plumbing"
:: "::"
identifier "QueryVTable"
; ";"
use_declaration (+34 nodes collapsed)
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "ty"
:: "::"
identifier "TyCtxt"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "verify_ich"
:: "::"
identifier "incremental_verify_ich"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_span"
:: "::"
use_list
{ "{"
identifier "DUMMY_SP"
, ","
identifier "Span"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "dep_graph"
:: "::"
use_list
{ "{"
identifier "DepNode"
, ","
identifier "DepNodeIndex"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
crate "crate"
:: "::"
identifier "for_each_query_vtable"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "job"
:: "::"
use_list
{ "{"
identifier "QueryJobInfo"
, ","
identifier "QueryJobMap"
, ","
identifier "find_cycle_in_stack"
, ","
identifier "report_cycle"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "plumbing"
:: "::"
use_list
{ "{"
identifier "current_query_job"
, ","
identifier "next_job_id"
, ","
identifier "start_query"
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
] "]"
function_item (+55 nodes collapsed)
function_item (+72 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns a map of currently active query jobs, collected fro"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " If `require_complete` is `true`, this function locks all sh"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " query results to produce a complete map, which always retur"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Otherwise, it may return an incomplete map as an error if a"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " lock cannot be acquired.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Prefer passing `false` to `require_complete` to avoid poten"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " especially when called from within a deadlock handler, unle"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " complete map is needed and no deadlock is possible at this "...
function_item (+154 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Internal plumbing for collecting the set of active jobs for"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Should only be called from `collect_active_jobs_from_all_qu"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " (We arbitrarily use the word \"gather\" when collecting the j"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " each individual query, so that we have distinct function na"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " grep for.)\n"
function_item (+444 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cold"
] "]"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "mk_cycle"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters
( "("
parameter
identifier "query"
: ":"
reference_type
& "&"
lifetime
' "'"
identifier "tcx"
generic_type
type_identifier "QueryVTable"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
, ","
type_identifier "C"
> ">"
, ","
parameter
identifier "tcx"
: ":"
generic_type
type_identifier "TyCtxt"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
> ">"
, ","
parameter
identifier "cycle_error"
: ":"
type_identifier "CycleError"
, ","
) ")"
-> "->"
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
block
{ "{"
let_declaration
let "let"
identifier "error"
= "="
call_expression
identifier "report_cycle"
arguments
( "("
field_expression
identifier "tcx"
. "."
field_identifier "sess"
, ","
reference_expression
& "&"
identifier "cycle_error"
) ")"
; ";"
expression_statement
match_expression
match "match"
field_expression
identifier "query"
. "."
field_identifier "cycle_error_handling"
match_block
{ "{"
match_arm
match_pattern
scoped_identifier
identifier "CycleErrorHandling"
:: "::"
identifier "Error"
=> "=>"
block
{ "{"
let_declaration
let "let"
identifier "guar"
= "="
call_expression
field_expression
identifier "error"
. "."
field_identifier "emit"
arguments
( "("
) ")"
; ";"
call_expression
parenthesized_expression
( "("
field_expression
identifier "query"
. "."
field_identifier "value_from_cycle_error"
) ")"
arguments
( "("
identifier "tcx"
, ","
identifier "cycle_error"
, ","
identifier "guar"
) ")"
} "}"
match_arm
match_pattern
scoped_identifier
identifier "CycleErrorHandling"
:: "::"
identifier "DelayBug"
=> "=>"
block
{ "{"
let_declaration
let "let"
identifier "guar"
= "="
call_expression
field_expression
identifier "error"
. "."
field_identifier "delay_as_bug"
arguments
( "("
) ")"
; ";"
call_expression
parenthesized_expression
( "("
field_expression
identifier "query"
. "."
field_identifier "value_from_cycle_error"
) ")"
arguments
( "("
identifier "tcx"
, ","
identifier "cycle_error"
, ","
identifier "guar"
) ")"
} "}"
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Guard object representing the responsibility to execute a q"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " mark it as completed.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This will poison the relevant query key if it is dropped wi"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " [`Self::complete`].\n"
struct_item (+57 nodes collapsed)
impl_item (+366 nodes collapsed)
impl_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cold"
] "]"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "cycle_error"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters
( "("
parameter
identifier "query"
: ":"
reference_type
& "&"
lifetime
' "'"
identifier "tcx"
generic_type
type_identifier "QueryVTable"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
, ","
type_identifier "C"
> ">"
, ","
parameter
identifier "tcx"
: ":"
generic_type
type_identifier "TyCtxt"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
> ">"
, ","
parameter
identifier "try_execute"
: ":"
type_identifier "QueryJobId"
, ","
parameter
identifier "span"
: ":"
type_identifier "Span"
, ","
) ")"
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
line_comment
// "//"
line_comment
// "//"
let_declaration (+32 nodes collapsed)
let_declaration (+23 nodes collapsed)
tuple_expression
( "("
call_expression
identifier "mk_cycle"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
call_expression
field_expression
identifier "error"
. "."
field_identifier "lift"
arguments
( "("
) ")"
) ")"
, ","
identifier "None"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item
fn "fn"
identifier "wait_for_query"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters (+69 nodes collapsed)
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
let_declaration
let "let"
identifier "query_blocked_prof_timer"
= "="
call_expression
field_expression
field_expression
identifier "tcx"
. "."
field_identifier "prof"
. "."
field_identifier "query_blocked"
arguments
( "("
) ")"
; ";"
line_comment
// "//"
line_comment
// "//"
let_declaration
let "let"
identifier "result"
= "="
call_expression
field_expression
identifier "latch"
. "."
field_identifier "wait_on"
arguments
( "("
identifier "tcx"
, ","
identifier "current"
, ","
identifier "span"
) ")"
; ";"
expression_statement
match_expression
match "match"
identifier "result"
match_block
{ "{"
match_arm (+215 nodes collapsed)
match_arm
match_pattern
tuple_struct_pattern
identifier "Err"
( "("
identifier "cycle"
) ")"
=> "=>"
tuple_expression
( "("
call_expression
identifier "mk_cycle"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
call_expression
field_expression
identifier "cycle"
. "."
field_identifier "lift"
arguments
( "("
) ")"
) ")"
, ","
identifier "None"
) ")"
, ","
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Shared main part of both [`execute_query_incr_inner`] and ["...
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "try_execute_query"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
, ","
const_parameter
const "const"
identifier "INCR"
: ":"
primitive_type "bool"
> ">"
parameters (+61 nodes collapsed)
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
let_declaration
let "let"
identifier "key_hash"
= "="
call_expression
scoped_identifier
identifier "sharded"
:: "::"
identifier "make_hash"
arguments
( "("
reference_expression
& "&"
identifier "key"
) ")"
; ";"
let_declaration (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
expression_statement (+89 nodes collapsed)
let_declaration
let "let"
identifier "current_job_id"
= "="
call_expression
identifier "current_query_job"
arguments
( "("
) ")"
; ";"
expression_statement
match_expression
match "match"
call_expression (+36 nodes collapsed)
match_block
{ "{"
match_arm (+105 nodes collapsed)
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "Entry"
:: "::"
identifier "Occupied"
( "("
mut_pattern
mutable_specifier "mut"
identifier "entry"
) ")"
=> "=>"
block
{ "{"
expression_statement
match_expression
match "match"
reference_expression
& "&"
mutable_specifier "mut"
field_expression
call_expression
field_expression
identifier "entry"
. "."
field_identifier "get_mut"
arguments
( "("
) ")"
. "."
integer_literal "1"
match_block
{ "{"
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "ActiveKeyStatus"
:: "::"
identifier "Started"
( "("
identifier "job"
) ")"
=> "=>"
block
{ "{"
expression_statement
if_expression
if "if"
call_expression
scoped_identifier
identifier "sync"
:: "::"
identifier "is_dyn_thread_safe"
arguments
( "("
) ")"
block (+46 nodes collapsed)
else_clause
else "else"
block
{ "{"
let_declaration
let "let"
identifier "id"
= "="
field_expression
identifier "job"
. "."
field_identifier "id"
; ";"
expression_statement
call_expression
identifier "drop"
arguments
( "("
identifier "state_lock"
) ")"
; ";"
line_comment
// "//"
line_comment
// "//"
call_expression
identifier "cycle_error"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
identifier "id"
, ","
identifier "span"
) ")"
} "}"
} "}"
match_arm
match_pattern
scoped_identifier
identifier "ActiveKeyStatus"
:: "::"
identifier "Poisoned"
=> "=>"
call_expression
field_expression
identifier "FatalError"
. "."
field_identifier "raise"
arguments
( "("
) ")"
, ","
} "}"
} "}"
} "}"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+468 nodes collapsed)
line_comment
// "//"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+268 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+477 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Given that the dep node for this query+key is green, obtain"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " by loading one from disk if possible, or by invoking its qu"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " necessary.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+511 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Return value struct for [`check_if_ensure_can_skip_executio"...
struct_item (+41 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Checks whether a `tcx.ensure_ok()` or `tcx.ensure_done()` q"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " return early without actually trying to execute.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This only makes sense during incremental compilation, becau"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " on having the dependency graph (and in some cases a disk-ca"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " from the previous incr-comp session.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item (+351 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Called by a macro-generated impl of [`QueryVTable::execute_"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in non-incremental mode.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+128 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Called by a macro-generated impl of [`QueryVTable::execute_"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in incremental mode.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+265 nodes collapsed)
function_item (+187 nodes collapsed)

After

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "hash"
:: "::"
identifier "Hash"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "mem"
:: "::"
identifier "ManuallyDrop"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "hash_table"
:: "::"
use_list
{ "{"
identifier "Entry"
, ","
identifier "HashTable"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "stack"
:: "::"
identifier "ensure_sufficient_stack"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_data_structures"
:: "::"
identifier "sync"
:: "::"
use_list
{ "{"
identifier "DynSend"
, ","
identifier "DynSync"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_data_structures"
:: "::"
use_list
{ "{"
identifier "outline"
, ","
identifier "sharded"
, ","
identifier "sync"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_errors"
:: "::"
identifier "FatalError"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "dep_graph"
:: "::"
use_list
{ "{"
identifier "DepGraphData"
, ","
identifier "DepNodeKey"
, ","
identifier "SerializedDepNodeIndex"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "query"
:: "::"
identifier "plumbing"
:: "::"
identifier "QueryVTable"
; ";"
use_declaration (+34 nodes collapsed)
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "ty"
:: "::"
identifier "TyCtxt"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "verify_ich"
:: "::"
identifier "incremental_verify_ich"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_span"
:: "::"
use_list
{ "{"
identifier "DUMMY_SP"
, ","
identifier "Span"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "dep_graph"
:: "::"
use_list
{ "{"
identifier "DepNode"
, ","
identifier "DepNodeIndex"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
crate "crate"
:: "::"
identifier "for_each_query_vtable"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "job"
:: "::"
use_list
{ "{"
identifier "QueryJobInfo"
, ","
identifier "QueryJobMap"
, ","
identifier "find_cycle_in_stack"
, ","
identifier "report_cycle"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "plumbing"
:: "::"
use_list
{ "{"
identifier "current_query_job"
, ","
identifier "next_job_id"
, ","
identifier "start_query"
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
] "]"
function_item (+55 nodes collapsed)
function_item (+72 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns a map of currently active query jobs, collected fro"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " If `require_complete` is `true`, this function locks all sh"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " query results to produce a complete map, which always retur"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Otherwise, it may return an incomplete map as an error if a"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " lock cannot be acquired.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Prefer passing `false` to `require_complete` to avoid poten"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " especially when called from within a deadlock handler, unle"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " complete map is needed and no deadlock is possible at this "...
function_item (+154 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Internal plumbing for collecting the set of active jobs for"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Should only be called from `collect_active_jobs_from_all_qu"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " (We arbitrarily use the word \"gather\" when collecting the j"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " each individual query, so that we have distinct function na"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " grep for.)\n"
function_item (+444 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cold"
] "]"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "mk_cycle"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters
( "("
parameter
identifier "query"
: ":"
reference_type
& "&"
lifetime
' "'"
identifier "tcx"
generic_type
type_identifier "QueryVTable"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
, ","
type_identifier "C"
> ">"
, ","
parameter
identifier "tcx"
: ":"
generic_type
type_identifier "TyCtxt"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
> ">"
, ","
parameter
identifier "key"
: ":"
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Key"
, ","
parameter
identifier "cycle_error"
: ":"
type_identifier "CycleError"
, ","
) ")"
-> "->"
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
block
{ "{"
let_declaration
let "let"
identifier "error"
= "="
call_expression
identifier "report_cycle"
arguments
( "("
field_expression
identifier "tcx"
. "."
field_identifier "sess"
, ","
reference_expression
& "&"
identifier "cycle_error"
) ")"
; ";"
expression_statement
match_expression
match "match"
field_expression
identifier "query"
. "."
field_identifier "cycle_error_handling"
match_block
{ "{"
match_arm
match_pattern
scoped_identifier
identifier "CycleErrorHandling"
:: "::"
identifier "Error"
=> "=>"
block
{ "{"
let_declaration
let "let"
identifier "guar"
= "="
call_expression
field_expression
identifier "error"
. "."
field_identifier "emit"
arguments
( "("
) ")"
; ";"
call_expression
parenthesized_expression
( "("
field_expression
identifier "query"
. "."
field_identifier "value_from_cycle_error"
) ")"
arguments
( "("
identifier "tcx"
, ","
identifier "key"
, ","
identifier "cycle_error"
, ","
identifier "guar"
) ")"
} "}"
match_arm
match_pattern
scoped_identifier
identifier "CycleErrorHandling"
:: "::"
identifier "DelayBug"
=> "=>"
block
{ "{"
let_declaration
let "let"
identifier "guar"
= "="
call_expression
field_expression
identifier "error"
. "."
field_identifier "delay_as_bug"
arguments
( "("
) ")"
; ";"
call_expression
parenthesized_expression
( "("
field_expression
identifier "query"
. "."
field_identifier "value_from_cycle_error"
) ")"
arguments
( "("
identifier "tcx"
, ","
identifier "key"
, ","
identifier "cycle_error"
, ","
identifier "guar"
) ")"
} "}"
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Guard object representing the responsibility to execute a q"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " mark it as completed.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This will poison the relevant query key if it is dropped wi"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " [`Self::complete`].\n"
struct_item (+57 nodes collapsed)
impl_item (+366 nodes collapsed)
impl_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cold"
] "]"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "cycle_error"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters
( "("
parameter
identifier "query"
: ":"
reference_type
& "&"
lifetime
' "'"
identifier "tcx"
generic_type
type_identifier "QueryVTable"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
, ","
type_identifier "C"
> ">"
, ","
parameter
identifier "tcx"
: ":"
generic_type
type_identifier "TyCtxt"
type_arguments
< "<"
lifetime
' "'"
identifier "tcx"
> ">"
, ","
parameter
identifier "key"
: ":"
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Key"
, ","
parameter
identifier "try_execute"
: ":"
type_identifier "QueryJobId"
, ","
parameter
identifier "span"
: ":"
type_identifier "Span"
, ","
) ")"
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
line_comment
// "//"
line_comment
// "//"
let_declaration (+32 nodes collapsed)
let_declaration (+23 nodes collapsed)
tuple_expression
( "("
call_expression
identifier "mk_cycle"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
identifier "key"
, ","
call_expression
field_expression
identifier "error"
. "."
field_identifier "lift"
arguments
( "("
) ")"
) ")"
, ","
identifier "None"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item
fn "fn"
identifier "wait_for_query"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
> ">"
parameters (+69 nodes collapsed)
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
let_declaration
let "let"
identifier "query_blocked_prof_timer"
= "="
call_expression
field_expression
field_expression
identifier "tcx"
. "."
field_identifier "prof"
. "."
field_identifier "query_blocked"
arguments
( "("
) ")"
; ";"
line_comment
// "//"
line_comment
// "//"
let_declaration
let "let"
identifier "result"
= "="
call_expression
field_expression
identifier "latch"
. "."
field_identifier "wait_on"
arguments
( "("
identifier "tcx"
, ","
identifier "current"
, ","
identifier "span"
) ")"
; ";"
expression_statement
match_expression
match "match"
identifier "result"
match_block
{ "{"
match_arm (+215 nodes collapsed)
match_arm
match_pattern
tuple_struct_pattern
identifier "Err"
( "("
identifier "cycle"
) ")"
=> "=>"
tuple_expression
( "("
call_expression
identifier "mk_cycle"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
identifier "key"
, ","
call_expression
field_expression
identifier "cycle"
. "."
field_identifier "lift"
arguments
( "("
) ")"
) ")"
, ","
identifier "None"
) ")"
, ","
} "}"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Shared main part of both [`execute_query_incr_inner`] and ["...
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item
fn "fn"
identifier "try_execute_query"
type_parameters
< "<"
lifetime_parameter
lifetime
' "'"
identifier "tcx"
, ","
type_parameter
type_identifier "C"
trait_bounds
: ":"
type_identifier "QueryCache"
, ","
const_parameter
const "const"
identifier "INCR"
: ":"
primitive_type "bool"
> ">"
parameters (+61 nodes collapsed)
-> "->"
tuple_type
( "("
scoped_type_identifier
identifier "C"
:: "::"
type_identifier "Value"
, ","
generic_type
type_identifier "Option"
type_arguments
< "<"
type_identifier "DepNodeIndex"
> ">"
) ")"
block
{ "{"
let_declaration
let "let"
identifier "key_hash"
= "="
call_expression
scoped_identifier
identifier "sharded"
:: "::"
identifier "make_hash"
arguments
( "("
reference_expression
& "&"
identifier "key"
) ")"
; ";"
let_declaration (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
expression_statement (+89 nodes collapsed)
let_declaration
let "let"
identifier "current_job_id"
= "="
call_expression
identifier "current_query_job"
arguments
( "("
) ")"
; ";"
expression_statement
match_expression
match "match"
call_expression (+36 nodes collapsed)
match_block
{ "{"
match_arm (+105 nodes collapsed)
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "Entry"
:: "::"
identifier "Occupied"
( "("
mut_pattern
mutable_specifier "mut"
identifier "entry"
) ")"
=> "=>"
block
{ "{"
expression_statement
match_expression
match "match"
reference_expression
& "&"
mutable_specifier "mut"
field_expression
call_expression
field_expression
identifier "entry"
. "."
field_identifier "get_mut"
arguments
( "("
) ")"
. "."
integer_literal "1"
match_block
{ "{"
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "ActiveKeyStatus"
:: "::"
identifier "Started"
( "("
identifier "job"
) ")"
=> "=>"
block
{ "{"
expression_statement
if_expression
if "if"
call_expression
scoped_identifier
identifier "sync"
:: "::"
identifier "is_dyn_thread_safe"
arguments
( "("
) ")"
block (+46 nodes collapsed)
else_clause
else "else"
block
{ "{"
let_declaration
let "let"
identifier "id"
= "="
field_expression
identifier "job"
. "."
field_identifier "id"
; ";"
expression_statement
call_expression
identifier "drop"
arguments
( "("
identifier "state_lock"
) ")"
; ";"
line_comment
// "//"
line_comment
// "//"
call_expression
identifier "cycle_error"
arguments
( "("
identifier "query"
, ","
identifier "tcx"
, ","
identifier "key"
, ","
identifier "id"
, ","
identifier "span"
) ")"
} "}"
} "}"
match_arm
match_pattern
scoped_identifier
identifier "ActiveKeyStatus"
:: "::"
identifier "Poisoned"
=> "=>"
call_expression
field_expression
identifier "FatalError"
. "."
field_identifier "raise"
arguments
( "("
) ")"
, ","
} "}"
} "}"
} "}"
} "}"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+468 nodes collapsed)
line_comment
// "//"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+268 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+477 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Given that the dep node for this query+key is green, obtain"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " by loading one from disk if possible, or by invoking its qu"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " necessary.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+511 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Return value struct for [`check_if_ensure_can_skip_executio"...
struct_item (+41 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Checks whether a `tcx.ensure_ok()` or `tcx.ensure_done()` q"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " return early without actually trying to execute.\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This only makes sense during incremental compilation, becau"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " on having the dependency graph (and in some cases a disk-ca"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " from the previous incr-comp session.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "never"
) ")"
] "]"
function_item (+351 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Called by a macro-generated impl of [`QueryVTable::execute_"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in non-incremental mode.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+128 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Called by a macro-generated impl of [`QueryVTable::execute_"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " in incremental mode.\n"
attribute_item
# "#"
[ "["
attribute
identifier "inline"
token_tree
( "("
identifier "always"
) ")"
] "]"
function_item (+265 nodes collapsed)
function_item (+187 nodes collapsed)