Skip to content

Commit 19cfa64

Browse files
committed
Add documentation for some queries
1 parent 7314873 commit 19cfa64

File tree

1 file changed

+11
-1
lines changed
  • compiler/rustc_middle/src/query

1 file changed

+11
-1
lines changed

compiler/rustc_middle/src/query/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ pub use plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsure, TyCtxtEnsureWithValue
109109
// Queries marked with `fatal_cycle` do not need the latter implementation,
110110
// as they will raise an fatal error on query cycles instead.
111111
rustc_queries! {
112+
/// This exists purely for testing the interactions between delay_span_bug and incremental.
112113
query trigger_delay_span_bug(key: DefId) -> () {
113-
desc { "triggering a delay span bug" }
114+
desc { "triggering a delay span bug for testing incremental" }
114115
}
115116

117+
/// Collects the list of all tools registered using `#![register_tool]`.
116118
query registered_tools(_: ()) -> &'tcx ty::RegisteredTools {
117119
arena_cache
118120
desc { "compute registered tools for crate" }
@@ -286,6 +288,7 @@ rustc_queries! {
286288
}
287289
}
288290

291+
/// The root query triggering all analysis passes like typeck or borrowck.
289292
query analysis(key: ()) -> Result<(), ErrorGuaranteed> {
290293
eval_always
291294
desc { "running analysis passes on this crate" }
@@ -1785,10 +1788,17 @@ rustc_queries! {
17851788
desc { "calculating the missing lang items in a crate" }
17861789
separate_provide_extern
17871790
}
1791+
1792+
/// The visible parent map is a map from every item to a visible parent.
1793+
/// It prefers the shortest visible path to an item.
1794+
/// Used for diagnostics, for example path trimming.
1795+
/// The parents are modules, enums or traits.
17881796
query visible_parent_map(_: ()) -> &'tcx DefIdMap<DefId> {
17891797
arena_cache
17901798
desc { "calculating the visible parent map" }
17911799
}
1800+
/// Collects the "trimmed", shortest accessible paths to all items for diagnostics.
1801+
/// See the [provider docs](`rustc_middle::ty::print::trimmed_def_paths`) for more info.
17921802
query trimmed_def_paths(_: ()) -> &'tcx FxHashMap<DefId, Symbol> {
17931803
arena_cache
17941804
desc { "calculating trimmed def paths" }

0 commit comments

Comments
 (0)