]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_query_impl/src/lib.rs
Auto merge of #82936 - oli-obk:valtree, r=RalfJung,lcnr,matthewjasper
[rust.git] / compiler / rustc_query_impl / src / lib.rs
1 //! Support for serializing the dep-graph and reloading it.
2
3 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
4 #![feature(in_band_lifetimes)]
5 #![feature(exhaustive_patterns)]
6 #![feature(nll)]
7 #![feature(min_specialization)]
8 #![feature(crate_visibility_modifier)]
9 #![feature(once_cell)]
10 #![feature(rustc_attrs)]
11 #![feature(never_type)]
12 #![recursion_limit = "256"]
13
14 #[macro_use]
15 extern crate rustc_middle;
16 #[macro_use]
17 extern crate tracing;
18
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::CrateNum;
23 use rustc_index::vec::IndexVec;
24 use rustc_middle::dep_graph;
25 use rustc_middle::ich::StableHashingContext;
26 use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values};
27 use rustc_middle::ty::query::{Providers, QueryEngine};
28 use rustc_middle::ty::{self, TyCtxt};
29 use rustc_serialize::opaque;
30 use rustc_span::{Span, DUMMY_SP};
31
32 #[macro_use]
33 mod plumbing;
34 pub use plumbing::QueryCtxt;
35 use plumbing::QueryStruct;
36 use rustc_query_system::query::*;
37
38 mod stats;
39 pub use self::stats::print_stats;
40
41 mod keys;
42 use keys::Key;
43
44 mod values;
45 use self::values::Value;
46
47 use rustc_query_system::query::QueryAccessors;
48 pub use rustc_query_system::query::QueryConfig;
49 pub(crate) use rustc_query_system::query::QueryDescription;
50
51 use rustc_middle::ty::query::on_disk_cache;
52
53 mod profiling_support;
54 pub use self::profiling_support::alloc_self_profile_query_strings;
55
56 rustc_query_append! { [define_queries!][<'tcx>] }
57
58 impl<'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 }