Skip to main content

rustc_middle/query/
mod.rs

1use rustc_hir::def_id::LocalDefId;
2pub use rustc_query_system::query::{QueryMode, QueryState};
3
4pub use self::keys::{AsLocalKey, Key, LocalCrate};
5pub use self::plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk};
6pub use crate::queries::Providers;
7use crate::ty::TyCtxt;
8
9pub(crate) mod arena_cached;
10pub mod erase;
11pub(crate) mod inner;
12mod keys;
13pub mod on_disk_cache;
14#[macro_use]
15pub mod plumbing;
16pub mod values;
17
18pub fn describe_as_module(def_id: impl Into<LocalDefId>, tcx: TyCtxt<'_>) -> String {
19    let def_id = def_id.into();
20    if def_id.is_top_level_module() {
21        "top-level module".to_string()
22    } else {
23        ::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))
24    }
25}