diff options
| author | klensy <klensy@users.noreply.github.com> | 2023-11-27 18:09:17 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2023-11-27 18:13:15 +0300 |
| commit | 31d99836bff1dc3366a8cd370c019a789f193b88 (patch) | |
| tree | 7ad1cf23ec57dd7f7d5f4640140cc94f9d12a783 /compiler/rustc_query_system/src | |
| parent | b29a1e00f850e548f3021ea523d0e143724fa9b7 (diff) | |
| download | rust-31d99836bff1dc3366a8cd370c019a789f193b88.tar.gz rust-31d99836bff1dc3366a8cd370c019a789f193b88.zip | |
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
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/query/job.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/plumbing.rs | 7 |
3 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs index b38d71733b5..2a55ec72c5f 100644 --- a/compiler/rustc_query_system/src/query/job.rs +++ b/compiler/rustc_query_system/src/query/job.rs @@ -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() { diff --git a/compiler/rustc_query_system/src/query/mod.rs b/compiler/rustc_query_system/src/query/mod.rs index 05dee9f12db..96a0c7a033a 100644 --- a/compiler/rustc_query_system/src/query/mod.rs +++ b/compiler/rustc_query_system/src/query/mod.rs @@ -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; diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index ecbc7dc6b8f..2f9f094dae2 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -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) } |
