about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorMartin Zacho <hi@martinzacho.net>2025-01-06 09:04:22 +0100
committerMartin Zacho <hi@martinzacho.net>2025-01-06 09:43:05 +0100
commit38e10e56198759b37595c48c43441a3cafa390a4 (patch)
tree1b7562710d76deb2052c356ccf375c44f0003a7f /compiler/rustc_query_impl/src
parent83853ccdc3ac840c26aed112f854a3264f9cb614 (diff)
downloadrust-38e10e56198759b37595c48c43441a3cafa390a4.tar.gz
rust-38e10e56198759b37595c48c43441a3cafa390a4.zip
improve diagnostics for const eval query overflow
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/plumbing.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index 1b12af62ea5..a74457a8118 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -27,7 +27,7 @@ use rustc_query_system::query::{
     QueryCache, QueryConfig, QueryContext, QueryJobId, QueryMap, QuerySideEffects, QueryStackFrame,
     force_query,
 };
-use rustc_query_system::{LayoutOfDepth, QueryOverflow};
+use rustc_query_system::{QueryOverflow, QueryOverflowNote};
 use rustc_serialize::{Decodable, Encodable};
 use rustc_session::Limit;
 use rustc_span::def_id::LOCAL_CRATE;
@@ -154,12 +154,10 @@ impl QueryContext for QueryCtxt<'_> {
 
     fn depth_limit_error(self, job: QueryJobId) {
         let mut span = None;
-        let mut layout_of_depth = None;
-        if let Some((info, depth)) =
-            job.try_find_layout_root(self.collect_active_jobs(), dep_kinds::layout_of)
-        {
+        let mut note = None;
+        if let Some((info, depth)) = job.try_find_dep_kind_root(self.collect_active_jobs()) {
             span = Some(info.job.span);
-            layout_of_depth = Some(LayoutOfDepth { desc: info.query.description, depth });
+            note = Some(QueryOverflowNote { desc: info.query.description, depth });
         }
 
         let suggested_limit = match self.recursion_limit() {
@@ -169,7 +167,7 @@ impl QueryContext for QueryCtxt<'_> {
 
         self.sess.dcx().emit_fatal(QueryOverflow {
             span,
-            layout_of_depth,
+            note,
             suggested_limit,
             crate_name: self.crate_name(LOCAL_CRATE),
         });