@@ -271,6 +271,10 @@ rustc_queries! {
271
271
desc { |tcx| "elaborating item bounds for `{}`" , tcx. def_path_str( key) }
272
272
}
273
273
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
274
278
query native_libraries( _: CrateNum ) -> Vec <NativeLib > {
275
279
arena_cache
276
280
desc { "looking up the native libraries of a linked crate" }
@@ -1539,6 +1543,7 @@ rustc_queries! {
1539
1543
desc { "available upstream drop-glue for `{:?}`" , substs }
1540
1544
}
1541
1545
1546
+ /// Returns a list of all `extern` blocks of a crate.
1542
1547
query foreign_modules( _: CrateNum ) -> FxHashMap <DefId , ForeignModule > {
1543
1548
arena_cache
1544
1549
desc { "looking up the foreign modules of a linked crate" }
@@ -1550,27 +1555,37 @@ rustc_queries! {
1550
1555
query entry_fn( _: ( ) ) -> Option <( DefId , EntryFnType ) > {
1551
1556
desc { "looking up the entry function of a crate" }
1552
1557
}
1558
+
1559
+ /// Finds the `rustc_proc_macro_decls` item of a crate.
1553
1560
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" }
1555
1562
}
1563
+
1556
1564
// The macro which defines `rustc_metadata::provide_extern` depends on this query's name.
1557
1565
// Changing the name should cause a compiler error, but in case that changes, be aware.
1558
1566
query crate_hash( _: CrateNum ) -> Svh {
1559
1567
eval_always
1560
1568
desc { "looking up the hash a crate" }
1561
1569
separate_provide_extern
1562
1570
}
1571
+
1572
+ /// Gets the hash for the host proc macro. Used to support -Z dual-proc-macro.
1563
1573
query crate_host_hash( _: CrateNum ) -> Option <Svh > {
1564
1574
eval_always
1565
1575
desc { "looking up the hash of a host version of a crate" }
1566
1576
separate_provide_extern
1567
1577
}
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.
1568
1581
query extra_filename( _: CrateNum ) -> String {
1569
1582
arena_cache
1570
1583
eval_always
1571
1584
desc { "looking up the extra filename for a crate" }
1572
1585
separate_provide_extern
1573
1586
}
1587
+
1588
+ /// Gets the paths where the crate came from in the file system.
1574
1589
query crate_extern_paths( _: CrateNum ) -> Vec <PathBuf > {
1575
1590
arena_cache
1576
1591
eval_always
@@ -1594,6 +1609,7 @@ rustc_queries! {
1594
1609
separate_provide_extern
1595
1610
}
1596
1611
1612
+ /// Get the corresponding native library from the `native_libraries` query
1597
1613
query native_library( def_id: DefId ) -> Option <& ' tcx NativeLib > {
1598
1614
desc { |tcx| "getting the native library for `{}`" , tcx. def_path_str( def_id) }
1599
1615
}
0 commit comments