]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_query_impl/src/lib.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / compiler / rustc_query_impl / src / lib.rs
CommitLineData
6a06907d
XL
1//! Support for serializing the dep-graph and reloading it.
2
3#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
6a06907d 4#![feature(min_specialization)]
923072b8 5#![feature(never_type)]
136023e0 6#![feature(once_cell)]
6a06907d 7#![feature(rustc_attrs)]
6a06907d 8#![recursion_limit = "256"]
5e7ed085 9#![allow(rustc::potential_query_instability)]
6a06907d 10
136023e0
XL
11#[macro_use]
12extern crate rustc_macros;
6a06907d
XL
13#[macro_use]
14extern crate rustc_middle;
6a06907d 15
6a06907d 16use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
5099ac24 17use rustc_data_structures::sync::AtomicU64;
3c0e092e
XL
18use rustc_middle::arena::Arena;
19use rustc_middle::dep_graph::{self, DepKindStruct, SerializedDepNodeIndex};
6a06907d 20use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values};
3c0e092e 21use rustc_middle::ty::query::{ExternProviders, Providers, QueryEngine};
6a06907d 22use rustc_middle::ty::{self, TyCtxt};
923072b8 23use rustc_span::def_id::{LocalDefId, LOCAL_CRATE};
17df50a5 24use rustc_span::Span;
6a06907d
XL
25
26#[macro_use]
27mod plumbing;
28pub use plumbing::QueryCtxt;
6a06907d 29use rustc_query_system::query::*;
064997fb
FG
30#[cfg(parallel_compiler)]
31pub use rustc_query_system::query::{deadlock, QueryContext};
6a06907d 32
6a06907d
XL
33mod keys;
34use keys::Key;
35
36mod values;
37use self::values::Value;
38
6a06907d 39pub use rustc_query_system::query::QueryConfig;
064997fb 40pub(crate) use rustc_query_system::query::{QueryDescription, QueryVTable};
6a06907d 41
136023e0
XL
42mod on_disk_cache;
43pub use on_disk_cache::OnDiskCache;
6a06907d
XL
44
45mod profiling_support;
46pub use self::profiling_support::alloc_self_profile_query_strings;
47
3c0e092e
XL
48fn describe_as_module(def_id: LocalDefId, tcx: TyCtxt<'_>) -> String {
49 if def_id.is_top_level_module() {
50 "top-level module".to_string()
51 } else {
52 format!("module `{}`", tcx.def_path_str(def_id.to_def_id()))
53 }
54}
55
6a06907d
XL
56rustc_query_append! { [define_queries!][<'tcx>] }
57
58impl<'tcx> Queries<'tcx> {
59 // Force codegen in the dyn-trait transformation in this crate.
60 pub fn as_dyn(&'tcx self) -> &'tcx dyn QueryEngine<'tcx> {
61 self
62 }
63}