Skip to content

Commit 27e0f03

Browse files
committed
Add internal descriptions to a few queries
1 parent 04583f2 commit 27e0f03

File tree

1 file changed

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

1 file changed

+17
-1
lines changed

Diff for: compiler/rustc_middle/src/query/mod.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ rustc_queries! {
271271
desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
272272
}
273273

274+
/// Look up all native libraries this crate depends on.
275+
/// These are assembled from the following places:
276+
/// - `extern` blocks (depending on their `link` attributes)
277+
/// - the `libs` (`-l`) option
274278
query native_libraries(_: CrateNum) -> Vec<NativeLib> {
275279
arena_cache
276280
desc { "looking up the native libraries of a linked crate" }
@@ -1539,6 +1543,7 @@ rustc_queries! {
15391543
desc { "available upstream drop-glue for `{:?}`", substs }
15401544
}
15411545

1546+
/// Returns a list of all `extern` blocks of a crate.
15421547
query foreign_modules(_: CrateNum) -> FxHashMap<DefId, ForeignModule> {
15431548
arena_cache
15441549
desc { "looking up the foreign modules of a linked crate" }
@@ -1550,27 +1555,37 @@ rustc_queries! {
15501555
query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {
15511556
desc { "looking up the entry function of a crate" }
15521557
}
1558+
1559+
/// Finds the `rustc_proc_macro_decls` item of a crate.
15531560
query proc_macro_decls_static(_: ()) -> Option<LocalDefId> {
1554-
desc { "looking up the derive registrar for a crate" }
1561+
desc { "looking up the proc macro declarations for a crate" }
15551562
}
1563+
15561564
// The macro which defines `rustc_metadata::provide_extern` depends on this query's name.
15571565
// Changing the name should cause a compiler error, but in case that changes, be aware.
15581566
query crate_hash(_: CrateNum) -> Svh {
15591567
eval_always
15601568
desc { "looking up the hash a crate" }
15611569
separate_provide_extern
15621570
}
1571+
1572+
/// Gets the hash for the host proc macro. Used to support -Z dual-proc-macro.
15631573
query crate_host_hash(_: CrateNum) -> Option<Svh> {
15641574
eval_always
15651575
desc { "looking up the hash of a host version of a crate" }
15661576
separate_provide_extern
15671577
}
1578+
1579+
/// Gets the extra data to put in each output filename for a crate.
1580+
/// For example, compiling the `foo` crate with `extra-filename=-a` creates a `libfoo-b.rlib` file.
15681581
query extra_filename(_: CrateNum) -> String {
15691582
arena_cache
15701583
eval_always
15711584
desc { "looking up the extra filename for a crate" }
15721585
separate_provide_extern
15731586
}
1587+
1588+
/// Gets the paths where the crate came from in the file system.
15741589
query crate_extern_paths(_: CrateNum) -> Vec<PathBuf> {
15751590
arena_cache
15761591
eval_always
@@ -1594,6 +1609,7 @@ rustc_queries! {
15941609
separate_provide_extern
15951610
}
15961611

1612+
/// Get the corresponding native library from the `native_libraries` query
15971613
query native_library(def_id: DefId) -> Option<&'tcx NativeLib> {
15981614
desc { |tcx| "getting the native library for `{}`", tcx.def_path_str(def_id) }
15991615
}

0 commit comments

Comments
 (0)