]>
Commit | Line | Data |
---|---|---|
ea8adc8c XL |
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 | |
fc512014 | 11 | //! on MIR are found in `rustc_mir` crate. |
ea8adc8c XL |
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. | |
ea8adc8c | 16 | //! |
ba9703b0 | 17 | //! For more information about how rustc works, see the [rustc dev guide]. |
0531ce1d | 18 | //! |
ba9703b0 | 19 | //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/ |
1a4d82fc JJ |
20 | //! |
21 | //! # Note | |
22 | //! | |
23 | //! This API is completely unstable and subject to change. | |
24 | ||
1b1a35ee XL |
25 | #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] |
26 | #![feature(array_windows)] | |
17df50a5 | 27 | #![feature(assert_matches)] |
f9f354fc | 28 | #![feature(backtrace)] |
60c5eb7d | 29 | #![feature(bool_to_option)] |
85aaf69f | 30 | #![feature(box_patterns)] |
1a4d82fc | 31 | #![feature(box_syntax)] |
3157f602 | 32 | #![feature(core_intrinsics)] |
f9f354fc | 33 | #![feature(discriminant_kind)] |
cc61c64b | 34 | #![feature(never_type)] |
94b46f34 | 35 | #![feature(extern_types)] |
0bf4aa26 | 36 | #![feature(nll)] |
1b1a35ee | 37 | #![feature(once_cell)] |
f035d41b | 38 | #![feature(min_specialization)] |
0531ce1d | 39 | #![feature(trusted_len)] |
041b39d2 | 40 | #![feature(test)] |
94b46f34 | 41 | #![feature(in_band_lifetimes)] |
b7449926 | 42 | #![feature(crate_visibility_modifier)] |
416331ca | 43 | #![feature(associated_type_bounds)] |
e1599b0c | 44 | #![feature(rustc_attrs)] |
29967ef6 XL |
45 | #![feature(half_open_range_patterns)] |
46 | #![feature(exclusive_range_pattern)] | |
47 | #![feature(control_flow_enum)] | |
fc512014 | 48 | #![feature(associated_type_defaults)] |
cdc7bbd5 | 49 | #![feature(iter_zip)] |
17df50a5 | 50 | #![feature(thread_local_const_init)] |
136023e0 XL |
51 | #![feature(try_reserve)] |
52 | #![feature(nonzero_ops)] | |
dfeec247 | 53 | #![recursion_limit = "512"] |
7cac9316 | 54 | |
dfeec247 XL |
55 | #[macro_use] |
56 | extern crate bitflags; | |
57 | #[macro_use] | |
dfeec247 XL |
58 | extern crate rustc_macros; |
59 | #[macro_use] | |
60 | extern crate rustc_data_structures; | |
61 | #[macro_use] | |
3dfed10e | 62 | extern crate tracing; |
dfeec247 XL |
63 | #[macro_use] |
64 | extern crate smallvec; | |
b7449926 | 65 | |
416331ca XL |
66 | #[cfg(test)] |
67 | mod tests; | |
041b39d2 | 68 | |
9346a6ac AL |
69 | #[macro_use] |
70 | mod macros; | |
71 | ||
532ac7d7 XL |
72 | #[macro_use] |
73 | pub mod query; | |
74 | ||
48663c56 XL |
75 | #[macro_use] |
76 | pub mod arena; | |
6a06907d | 77 | #[macro_use] |
9cc50fc6 | 78 | pub mod dep_graph; |
54a0048b | 79 | pub mod hir; |
cc61c64b | 80 | pub mod ich; |
54a0048b SL |
81 | pub mod infer; |
82 | pub mod lint; | |
dfeec247 | 83 | pub mod middle; |
c30ab7b3 | 84 | pub mod mir; |
17df50a5 | 85 | pub mod thir; |
54a0048b SL |
86 | pub mod traits; |
87 | pub mod ty; | |
1a4d82fc JJ |
88 | |
89 | pub mod util { | |
b7449926 | 90 | pub mod bug; |
dfeec247 | 91 | pub mod common; |
1a4d82fc JJ |
92 | } |
93 | ||
ba9703b0 XL |
94 | // Allows macros to refer to this crate as `::rustc_middle` |
95 | extern crate self as rustc_middle; |