]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/lib.rs
Rollup merge of #88202 - azdavis:master, r=jyn514
[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_mir` 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(backtrace)]
30 #![feature(bool_to_option)]
31 #![feature(box_patterns)]
32 #![feature(core_intrinsics)]
33 #![feature(discriminant_kind)]
34 #![feature(if_let_guard)]
35 #![feature(never_type)]
36 #![feature(extern_types)]
37 #![feature(new_uninit)]
38 #![feature(nll)]
39 #![feature(once_cell)]
40 #![feature(min_specialization)]
41 #![feature(trusted_len)]
42 #![feature(test)]
43 #![feature(in_band_lifetimes)]
44 #![feature(crate_visibility_modifier)]
45 #![feature(associated_type_bounds)]
46 #![feature(rustc_attrs)]
47 #![feature(half_open_range_patterns)]
48 #![feature(exclusive_range_pattern)]
49 #![feature(control_flow_enum)]
50 #![feature(associated_type_defaults)]
51 #![feature(iter_zip)]
52 #![feature(thread_local_const_init)]
53 #![feature(try_reserve)]
54 #![feature(try_reserve_kind)]
55 #![feature(nonzero_ops)]
56 #![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard
57 #![recursion_limit = "512"]
58
59 #[macro_use]
60 extern crate bitflags;
61 #[macro_use]
62 extern crate rustc_macros;
63 #[macro_use]
64 extern crate rustc_data_structures;
65 #[macro_use]
66 extern crate tracing;
67 #[macro_use]
68 extern crate smallvec;
69
70 #[cfg(test)]
71 mod tests;
72
73 #[macro_use]
74 mod macros;
75
76 #[macro_use]
77 pub mod query;
78
79 #[macro_use]
80 pub mod arena;
81 #[macro_use]
82 pub mod dep_graph;
83 pub mod hir;
84 pub mod ich;
85 pub mod infer;
86 pub mod lint;
87 pub mod middle;
88 pub mod mir;
89 pub mod thir;
90 pub mod traits;
91 pub mod ty;
92
93 pub mod util {
94     pub mod bug;
95     pub mod common;
96 }
97
98 // Allows macros to refer to this crate as `::rustc_middle`
99 extern crate self as rustc_middle;