]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_query_impl/src/lib.rs
Auto merge of #103913 - Neutron3529:patch-1, r=thomcc
[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 // this shouldn't be necessary, but the check for `&mut _` is too naive and denies returning a function pointer that takes a mut ref
5 #![feature(const_mut_refs)]
6 #![feature(min_specialization)]
7 #![feature(never_type)]
8 #![feature(once_cell)]
9 #![feature(rustc_attrs)]
10 #![recursion_limit = "256"]
11 #![allow(rustc::potential_query_instability)]
12 #![deny(rustc::untranslatable_diagnostic)]
13 #![deny(rustc::diagnostic_outside_of_impl)]
14
15 #[macro_use]
16 extern crate rustc_macros;
17 #[macro_use]
18 extern crate rustc_middle;
19
20 use rustc_data_structures::sync::AtomicU64;
21 use rustc_middle::arena::Arena;
22 use rustc_middle::dep_graph::{self, DepKindStruct};
23 use rustc_middle::ty::query::{query_keys, query_storage, query_stored, query_values};
24 use rustc_middle::ty::query::{ExternProviders, Providers, QueryEngine};
25 use rustc_middle::ty::TyCtxt;
26 use rustc_span::Span;
27
28 #[macro_use]
29 mod plumbing;
30 pub use plumbing::QueryCtxt;
31 use rustc_query_system::query::*;
32 #[cfg(parallel_compiler)]
33 pub use rustc_query_system::query::{deadlock, QueryContext};
34
35 mod keys;
36 use keys::Key;
37
38 pub use rustc_query_system::query::QueryConfig;
39 pub(crate) use rustc_query_system::query::QueryVTable;
40
41 mod on_disk_cache;
42 pub use on_disk_cache::OnDiskCache;
43
44 mod profiling_support;
45 pub use self::profiling_support::alloc_self_profile_query_strings;
46
47 rustc_query_append! { define_queries! }
48
49 impl<'tcx> Queries<'tcx> {
50     // Force codegen in the dyn-trait transformation in this crate.
51     pub fn as_dyn(&'tcx self) -> &'tcx dyn QueryEngine<'tcx> {
52         self
53     }
54 }