1
Fork 0

QueryContext: rename try_collect_active_jobs -> collect_active_jobs and change it's return type from Option<QueryMap> to QueryMap

As there currently always Some(...) inside
This commit is contained in:
klensy 2023-11-27 18:09:17 +03:00
parent b29a1e00f8
commit 31d99836bf
5 changed files with 14 additions and 20 deletions

View file

@ -620,13 +620,13 @@ pub fn print_query_stack<Qcx: QueryContext>(
// state if it was responsible for triggering the panic.
let mut count_printed = 0;
let mut count_total = 0;
let query_map = qcx.try_collect_active_jobs();
let query_map = qcx.collect_active_jobs();
if let Some(ref mut file) = file {
let _ = writeln!(file, "\n\nquery stack during panic:");
}
while let Some(query) = current_query {
let Some(query_info) = query_map.as_ref().and_then(|map| map.get(&query)) else {
let Some(query_info) = query_map.get(&query) else {
break;
};
if Some(count_printed) < num_frames || num_frames.is_none() {

View file

@ -106,7 +106,7 @@ pub trait QueryContext: HasDepContext {
/// Get the query information from the TLS context.
fn current_query_job(self) -> Option<QueryJobId>;
fn try_collect_active_jobs(self) -> Option<QueryMap>;
fn collect_active_jobs(self) -> QueryMap;
/// Load side effects associated to the node in the previous session.
fn load_side_effects(self, prev_dep_node_index: SerializedDepNodeIndex) -> QuerySideEffects;

View file

@ -242,11 +242,8 @@ where
Q: QueryConfig<Qcx>,
Qcx: QueryContext,
{
let error = try_execute.find_cycle_in_stack(
qcx.try_collect_active_jobs().unwrap(),
&qcx.current_query_job(),
span,
);
let error =
try_execute.find_cycle_in_stack(qcx.collect_active_jobs(), &qcx.current_query_job(), span);
(mk_cycle(query, qcx, error), None)
}