don't return an Option from try_find_dep_kind

This commit is contained in:
Martin Zacho 2025-01-07 21:57:00 +01:00
parent 45f198197b
commit 66c9a59a14
3 changed files with 8 additions and 13 deletions

View file

@ -82,9 +82,9 @@ pub(crate) struct IncrementCompilation {
#[diag(query_system_query_overflow)]
pub struct QueryOverflow {
#[primary_span]
pub span: Option<Span>,
pub span: Span,
#[subdiagnostic]
pub note: Option<QueryOverflowNote>,
pub note: QueryOverflowNote,
pub suggested_limit: Limit,
pub crate_name: Symbol,
}

View file

@ -136,18 +136,18 @@ impl QueryJobId {
#[cold]
#[inline(never)]
pub fn try_find_dep_kind_root(&self, query_map: QueryMap) -> Option<(QueryJobInfo, usize)> {
pub fn find_dep_kind_root(&self, query_map: QueryMap) -> (QueryJobInfo, usize) {
let mut depth = 1;
let info = query_map.get(&self).unwrap();
let dep_kind = info.query.dep_kind;
let mut current_id = info.job.parent;
let mut last_layout = Some((info.clone(), depth));
let mut last_layout = (info.clone(), depth);
while let Some(id) = current_id {
let info = query_map.get(&id).unwrap();
if info.query.dep_kind == dep_kind {
depth += 1;
last_layout = Some((info.clone(), depth));
last_layout = (info.clone(), depth);
}
current_id = info.job.parent;
}