]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/lib.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / compiler / rustc_middle / src / lib.rs
1 //! The "main crate" of the Rust compiler. This crate contains common
2 //! type definitions that are used by the other crates in the rustc
3 //! "family". Some prominent examples (note that each of these modules
4 //! has their own README with further details).
5 //!
6 //! - **HIR.** The "high-level (H) intermediate representation (IR)" is
7 //!   defined in the `hir` module.
8 //! - **MIR.** The "mid-level (M) intermediate representation (IR)" is
9 //!   defined in the `mir` module. This module contains only the
10 //!   *definition* of the MIR; the passes that transform and operate
11 //!   on MIR are found in `rustc_const_eval` crate.
12 //! - **Types.** The internal representation of types used in rustc is
13 //!   defined in the `ty` module. This includes the **type context**
14 //!   (or `tcx`), which is the central context during most of
15 //!   compilation, containing the interners and other things.
16 //!
17 //! For more information about how rustc works, see the [rustc dev guide].
18 //!
19 //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
20 //!
21 //! # Note
22 //!
23 //! This API is completely unstable and subject to change.
24
25 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
26 #![feature(allocator_api)]
27 #![feature(array_windows)]
28 #![feature(assert_matches)]
29 #![feature(box_patterns)]
30 #![feature(core_intrinsics)]
31 #![feature(discriminant_kind)]
32 #![feature(exhaustive_patterns)]
33 #![feature(generators)]
34 #![feature(get_mut_unchecked)]
35 #![feature(if_let_guard)]
36 #![feature(iter_from_generator)]
37 #![feature(negative_impls)]
38 #![feature(never_type)]
39 #![feature(extern_types)]
40 #![feature(new_uninit)]
41 #![feature(once_cell)]
42 #![feature(let_chains)]
43 #![feature(min_specialization)]
44 #![feature(trusted_len)]
45 #![feature(type_alias_impl_trait)]
46 #![feature(strict_provenance)]
47 #![feature(associated_type_bounds)]
48 #![feature(rustc_attrs)]
49 #![feature(control_flow_enum)]
50 #![feature(associated_type_defaults)]
51 #![feature(trusted_step)]
52 #![feature(try_blocks)]
53 #![feature(try_reserve_kind)]
54 #![feature(nonzero_ops)]
55 #![feature(unwrap_infallible)]
56 #![feature(decl_macro)]
57 #![feature(drain_filter)]
58 #![feature(intra_doc_pointers)]
59 #![feature(yeet_expr)]
60 #![feature(result_option_inspect)]
61 #![feature(const_option)]
62 #![recursion_limit = "512"]
63 #![allow(rustc::potential_query_instability)]
64
65 #[macro_use]
66 extern crate bitflags;
67 #[macro_use]
68 extern crate rustc_macros;
69 #[macro_use]
70 extern crate rustc_data_structures;
71 #[macro_use]
72 extern crate tracing;
73 #[macro_use]
74 extern crate smallvec;
75
76 #[cfg(test)]
77 mod tests;
78
79 #[macro_use]
80 mod macros;
81
82 #[macro_use]
83 pub mod query;
84
85 #[macro_use]
86 pub mod arena;
87 #[macro_use]
88 pub mod dep_graph;
89 pub(crate) mod error;
90 pub mod hir;
91 pub mod infer;
92 pub mod lint;
93 pub mod metadata;
94 pub mod middle;
95 pub mod mir;
96 pub mod thir;
97 pub mod traits;
98 pub mod ty;
99 mod values;
100
101 pub mod util {
102     pub mod bug;
103     pub mod common;
104 }
105
106 // Allows macros to refer to this crate as `::rustc_middle`
107 extern crate self as rustc_middle;