Skip to main content

rustc_middle/query/
mod.rs

1use rustc_hir::def_id::LocalDefId;
2
3pub use self::caches::{DefIdCache, DefaultCache, QueryCache, SingleCache, VecCache};
4pub use self::into_query_key::IntoQueryKey;
5pub use self::job::{QueryJob, QueryJobId, QueryLatch, QueryWaiter};
6pub use self::keys::{AsLocalQueryKey, LocalCrate, QueryKey};
7pub use self::plumbing::{
8    ActiveKeyStatus, Cycle, EnsureMode, QueryMode, QueryState, QuerySystem, QueryVTable, TyCtxtAt,
9    TyCtxtEnsureDone, TyCtxtEnsureOk, TyCtxtEnsureResult,
10};
11pub use self::stack::QueryStackFrame;
12pub use crate::queries::Providers;
13use crate::ty::TyCtxt;
14
15pub(crate) mod arena_cached;
16mod caches;
17pub mod erase;
18pub(crate) mod inner;
19mod into_query_key;
20mod job;
21mod keys;
22pub(crate) mod modifiers;
23pub mod on_disk_cache;
24pub(crate) mod plumbing;
25mod stack;
26
27pub fn describe_as_module(def_id: impl Into<LocalDefId>, tcx: TyCtxt<'_>) -> String {
28    let def_id = def_id.into();
29    if def_id.is_top_level_module() {
30        "top-level module".to_string()
31    } else {
32        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("module `{0}`",
                tcx.def_path_str(def_id)))
    })format!("module `{}`", tcx.def_path_str(def_id))
33    }
34}