mirror of https://github.com/rust-lang/rust.git
Add a `hir_krate` query
This commit is contained in:
parent
63980cd0fb
commit
513e326f5b
|
@ -41,5 +41,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
}
|
||||
|
||||
pub fn provide(providers: &mut Providers<'_>) {
|
||||
providers.hir_crate = |tcx, _| tcx.hir_map.forest.untracked_krate();
|
||||
map::provide(providers);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,12 @@ rustc_queries! {
|
|||
}
|
||||
|
||||
Other {
|
||||
query hir_crate(key: CrateNum) -> &'tcx Crate<'tcx> {
|
||||
eval_always
|
||||
no_hash
|
||||
desc { "get the crate HIR" }
|
||||
}
|
||||
|
||||
/// Records the type of every item.
|
||||
query type_of(key: DefId) -> Ty<'tcx> {
|
||||
cache_on_disk_if { key.is_local() }
|
||||
|
|
|
@ -45,7 +45,7 @@ use rustc_data_structures::sync::Lrc;
|
|||
use rustc_hir as hir;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex};
|
||||
use rustc_hir::{HirIdSet, ItemLocalId, TraitCandidate};
|
||||
use rustc_hir::{Crate, HirIdSet, ItemLocalId, TraitCandidate};
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
||||
|
|
Loading…
Reference in New Issue