]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_middle/src/lib.rs
6ddc38b0066875b2c7b58379402ae00d6a2d7ffe
[rustc.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(array_windows)]
27 #![feature(assert_matches)]
28 #![feature(backtrace)]
29 #![feature(bool_to_option)]
30 #![feature(box_patterns)]
31 #![feature(box_syntax)]
32 #![feature(cmp_min_max_by)]
33 #![feature(const_fn)]
34 #![feature(const_panic)]
35 #![feature(core_intrinsics)]
36 #![feature(discriminant_kind)]
37 #![feature(never_type)]
38 #![feature(extern_types)]
39 #![feature(nll)]
40 #![feature(once_cell)]
41 #![feature(or_patterns)]
42 #![feature(min_specialization)]
43 #![feature(trusted_len)]
44 #![feature(test)]
45 #![feature(in_band_lifetimes)]
46 #![feature(crate_visibility_modifier)]
47 #![feature(associated_type_bounds)]
48 #![feature(rustc_attrs)]
49 #![feature(int_error_matching)]
50 #![feature(half_open_range_patterns)]
51 #![feature(exclusive_range_pattern)]
52 #![feature(control_flow_enum)]
53 #![feature(associated_type_defaults)]
54 #![recursion_limit = "512"]
55
56 #[macro_use]
57 extern crate bitflags;
58 #[macro_use]
59 extern crate rustc_macros;
60 #[macro_use]
61 extern crate rustc_data_structures;
62 #[macro_use]
63 extern crate tracing;
64 #[macro_use]
65 extern crate smallvec;
66
67 #[cfg(test)]
68 mod tests;
69
70 #[macro_use]
71 mod macros;
72
73 #[macro_use]
74 pub mod query;
75
76 #[macro_use]
77 pub mod arena;
78 #[macro_use]
79 pub mod dep_graph;
80 pub mod hir;
81 pub mod ich;
82 pub mod infer;
83 pub mod lint;
84 pub mod middle;
85 pub mod mir;
86 pub mod traits;
87 pub mod ty;
88
89 pub mod util {
90 pub mod bug;
91 pub mod common;
92 }
93
94 // Allows macros to refer to this crate as `::rustc_middle`
95 extern crate self as rustc_middle;