improve diagnostics for const eval query overflow
This commit is contained in:
parent
83853ccdc3
commit
38e10e5619
7 changed files with 32 additions and 26 deletions
|
@ -15,7 +15,7 @@ use rustc_span::{DUMMY_SP, Span};
|
|||
use crate::dep_graph::DepContext;
|
||||
use crate::error::CycleStack;
|
||||
use crate::query::plumbing::CycleError;
|
||||
use crate::query::{DepKind, QueryContext, QueryStackFrame};
|
||||
use crate::query::{QueryContext, QueryStackFrame};
|
||||
|
||||
/// Represents a span and a query key.
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -136,18 +136,16 @@ impl QueryJobId {
|
|||
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
pub fn try_find_layout_root(
|
||||
&self,
|
||||
query_map: QueryMap,
|
||||
layout_of_kind: DepKind,
|
||||
) -> Option<(QueryJobInfo, usize)> {
|
||||
let mut last_layout = None;
|
||||
let mut current_id = Some(*self);
|
||||
let mut depth = 0;
|
||||
pub fn try_find_dep_kind_root(&self, query_map: QueryMap) -> Option<(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));
|
||||
|
||||
while let Some(id) = current_id {
|
||||
let info = query_map.get(&id).unwrap();
|
||||
if info.query.dep_kind == layout_of_kind {
|
||||
if info.query.dep_kind == dep_kind {
|
||||
depth += 1;
|
||||
last_layout = Some((info.clone(), depth));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue