1 //! Support for serializing the dep-graph and reloading it.
3 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
4 #![feature(in_band_lifetimes)]
5 #![feature(exhaustive_patterns)]
7 #![feature(min_specialization)]
8 #![feature(crate_visibility_modifier)]
10 #![feature(rustc_attrs)]
11 #![feature(never_type)]
12 #![recursion_limit = "256"]
15 extern crate rustc_middle;
19 use rustc_data_structures::fingerprint::Fingerprint;
20 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
21 use rustc_errors::{DiagnosticBuilder, Handler};
22 use rustc_hir::def_id::LOCAL_CRATE;
23 use rustc_middle::dep_graph;
24 use rustc_middle::ich::StableHashingContext;
25 use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values};
26 use rustc_middle::ty::query::{Providers, QueryEngine};
27 use rustc_middle::ty::{self, TyCtxt};
28 use rustc_serialize::opaque;
29 use rustc_span::{Span, DUMMY_SP};
33 pub use plumbing::QueryCtxt;
34 use plumbing::QueryStruct;
35 use rustc_query_system::query::*;
38 pub use self::stats::print_stats;
44 use self::values::Value;
46 use rustc_query_system::query::QueryAccessors;
47 pub use rustc_query_system::query::QueryConfig;
48 pub(crate) use rustc_query_system::query::QueryDescription;
50 use rustc_middle::ty::query::on_disk_cache;
52 mod profiling_support;
53 pub use self::profiling_support::alloc_self_profile_query_strings;
55 rustc_query_append! { [define_queries!][<'tcx>] }
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> {