about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2024-08-18 15:48:22 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2024-10-04 23:01:09 +0000
commit99144726a43b6ed5a5010837080f2a7c70c4ec52 (patch)
treef2150544241e7d582dbf66ba91842c4c81a2cf79
parent14f303bc1430a78ddaa91b3e104bbe4c0413184e (diff)
downloadrust-99144726a43b6ed5a5010837080f2a7c70c4ec52.tar.gz
rust-99144726a43b6ed5a5010837080f2a7c70c4ec52.zip
Make query backtrace more useful.
-rw-r--r--compiler/rustc_middle/src/query/mod.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index 989fbd711c3..9b7dfaab601 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1738,16 +1738,16 @@ rustc_queries! {
     /// Does lifetime resolution on items. Importantly, we can't resolve
     /// lifetimes directly on things like trait methods, because of trait params.
     /// See `rustc_resolve::late::lifetimes` for details.
-    query resolve_bound_vars(_: hir::OwnerId) -> &'tcx ResolveBoundVars {
+    query resolve_bound_vars(def_id: hir::OwnerId) -> &'tcx ResolveBoundVars {
         arena_cache
-        desc { "resolving lifetimes" }
+        desc { |tcx| "resolving lifetimes for `{}`", tcx.def_path_str(def_id) }
     }
-    query named_variable_map(_: hir::OwnerId) ->
+    query named_variable_map(def_id: hir::OwnerId) ->
         Option<&'tcx FxIndexMap<ItemLocalId, ResolvedArg>> {
-        desc { "looking up a named region" }
+        desc { |tcx| "looking up a named region inside `{}`", tcx.def_path_str(def_id) }
     }
-    query is_late_bound_map(_: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
-        desc { "testing if a region is late bound" }
+    query is_late_bound_map(def_id: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
+        desc { |tcx| "testing if a region is late bound inside `{}`", tcx.def_path_str(def_id) }
     }
     /// For a given item's generic parameter, gets the default lifetimes to be used
     /// for each parameter if a trait object were to be passed for that parameter.
@@ -1758,9 +1758,9 @@ rustc_queries! {
         desc { "looking up lifetime defaults for generic parameter `{}`", tcx.def_path_str(key) }
         separate_provide_extern
     }
-    query late_bound_vars_map(_: hir::OwnerId)
+    query late_bound_vars_map(def_id: hir::OwnerId)
         -> Option<&'tcx FxIndexMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {
-        desc { "looking up late bound vars" }
+        desc { |tcx| "looking up late bound vars inside `{}`", tcx.def_path_str(def_id) }
     }
 
     /// Computes the visibility of the provided `def_id`.