diff options
| author | Martin Zacho <hi@martinzacho.net> | 2025-01-07 21:57:00 +0100 |
|---|---|---|
| committer | Martin Zacho <hi@martinzacho.net> | 2025-01-07 21:57:00 +0100 |
| commit | 66c9a59a144658566cdc1292b9cc9da2fa85edf3 (patch) | |
| tree | 18fa4c856771bab9f40e0b08b8c21fa124a4467c /compiler/rustc_query_impl | |
| parent | 45f198197b5742c347311c2457be5e23ecbaec33 (diff) | |
| download | rust-66c9a59a144658566cdc1292b9cc9da2fa85edf3.tar.gz rust-66c9a59a144658566cdc1292b9cc9da2fa85edf3.zip | |
don't return an Option from try_find_dep_kind
Diffstat (limited to 'compiler/rustc_query_impl')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index a74457a8118..46ec538735a 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -153,12 +153,7 @@ impl QueryContext for QueryCtxt<'_> { } fn depth_limit_error(self, job: QueryJobId) { - let mut span = None; - let mut note = None; - if let Some((info, depth)) = job.try_find_dep_kind_root(self.collect_active_jobs()) { - span = Some(info.job.span); - note = Some(QueryOverflowNote { desc: info.query.description, depth }); - } + let (info, depth) = job.find_dep_kind_root(self.collect_active_jobs()); let suggested_limit = match self.recursion_limit() { Limit(0) => Limit(2), @@ -166,8 +161,8 @@ impl QueryContext for QueryCtxt<'_> { }; self.sess.dcx().emit_fatal(QueryOverflow { - span, - note, + span: info.job.span, + note: QueryOverflowNote { desc: info.query.description, depth }, suggested_limit, crate_name: self.crate_name(LOCAL_CRATE), }); |
