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