]>
Commit | Line | Data |
---|---|---|
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/")] | |
136023e0 | 4 | #![feature(crate_visibility_modifier)] |
6a06907d XL |
5 | #![feature(nll)] |
6 | #![feature(min_specialization)] | |
136023e0 | 7 | #![feature(once_cell)] |
6a06907d | 8 | #![feature(rustc_attrs)] |
6a06907d | 9 | #![recursion_limit = "256"] |
5e7ed085 | 10 | #![allow(rustc::potential_query_instability)] |
6a06907d | 11 | |
136023e0 XL |
12 | #[macro_use] |
13 | extern crate rustc_macros; | |
6a06907d XL |
14 | #[macro_use] |
15 | extern crate rustc_middle; | |
6a06907d | 16 | |
6a06907d | 17 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
5099ac24 | 18 | use rustc_data_structures::sync::AtomicU64; |
3c0e092e XL |
19 | use rustc_middle::arena::Arena; |
20 | use rustc_middle::dep_graph::{self, DepKindStruct, SerializedDepNodeIndex}; | |
6a06907d | 21 | use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values}; |
3c0e092e | 22 | use rustc_middle::ty::query::{ExternProviders, Providers, QueryEngine}; |
6a06907d | 23 | use rustc_middle::ty::{self, TyCtxt}; |
3c0e092e | 24 | use rustc_span::def_id::LocalDefId; |
17df50a5 | 25 | use rustc_span::Span; |
6a06907d XL |
26 | |
27 | #[macro_use] | |
28 | mod plumbing; | |
29 | pub use plumbing::QueryCtxt; | |
6a06907d XL |
30 | use rustc_query_system::query::*; |
31 | ||
6a06907d XL |
32 | mod keys; |
33 | use keys::Key; | |
34 | ||
35 | mod values; | |
36 | use self::values::Value; | |
37 | ||
6a06907d | 38 | pub use rustc_query_system::query::QueryConfig; |
3c0e092e | 39 | pub(crate) use rustc_query_system::query::{QueryDescription, QueryVtable}; |
6a06907d | 40 | |
136023e0 XL |
41 | mod on_disk_cache; |
42 | pub use on_disk_cache::OnDiskCache; | |
6a06907d XL |
43 | |
44 | mod profiling_support; | |
45 | pub use self::profiling_support::alloc_self_profile_query_strings; | |
46 | ||
3c0e092e XL |
47 | fn describe_as_module(def_id: LocalDefId, tcx: TyCtxt<'_>) -> String { |
48 | if def_id.is_top_level_module() { | |
49 | "top-level module".to_string() | |
50 | } else { | |
51 | format!("module `{}`", tcx.def_path_str(def_id.to_def_id())) | |
52 | } | |
53 | } | |
54 | ||
6a06907d XL |
55 | rustc_query_append! { [define_queries!][<'tcx>] } |
56 | ||
57 | impl<'tcx> Queries<'tcx> { | |
58 | // Force codegen in the dyn-trait transformation in this crate. | |
59 | pub fn as_dyn(&'tcx self) -> &'tcx dyn QueryEngine<'tcx> { | |
60 | self | |
61 | } | |
62 | } |