Rollup merge of #132131 - celinval:smir-crate-defs, r=compiler-errors
[StableMIR] API to retrieve definitions from crates Add functions to retrieve function definitions and static items from all crates (local and external). For external crates, we're still missing items from trait implementation and primitives. r? ````@compiler-errors:```` Do you know what is the best way to retrieve the associated items for primitives and trait implementations for external crates? Thanks!
This commit is contained in:
commit
4036472749
7 changed files with 225 additions and 4 deletions
|
@ -1844,6 +1844,16 @@ rustc_queries! {
|
|||
desc { |tcx| "computing crate imported by `{}`", tcx.def_path_str(def_id) }
|
||||
}
|
||||
|
||||
/// Gets the number of definitions in a foreign crate.
|
||||
///
|
||||
/// This allows external tools to iterate over all definitions in a foreign crate.
|
||||
///
|
||||
/// This should never be used for the local crate, instead use `iter_local_def_id`.
|
||||
query num_extern_def_ids(_: CrateNum) -> usize {
|
||||
desc { "fetching the number of definitions in a crate" }
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
query lib_features(_: CrateNum) -> &'tcx LibFeatures {
|
||||
desc { "calculating the lib features defined in a crate" }
|
||||
separate_provide_extern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue