]>
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 | |
c295e0f8 | 11 | //! on MIR are found in `rustc_const_eval` 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 | 25 | #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] |
94222f64 | 26 | #![feature(allocator_api)] |
1b1a35ee | 27 | #![feature(array_windows)] |
17df50a5 | 28 | #![feature(assert_matches)] |
85aaf69f | 29 | #![feature(box_patterns)] |
3157f602 | 30 | #![feature(core_intrinsics)] |
f9f354fc | 31 | #![feature(discriminant_kind)] |
c295e0f8 | 32 | #![feature(exhaustive_patterns)] |
487cf647 | 33 | #![feature(generators)] |
a2a8927a | 34 | #![feature(get_mut_unchecked)] |
94222f64 | 35 | #![feature(if_let_guard)] |
487cf647 | 36 | #![feature(iter_from_generator)] |
04454e1e | 37 | #![feature(negative_impls)] |
cc61c64b | 38 | #![feature(never_type)] |
94b46f34 | 39 | #![feature(extern_types)] |
94222f64 | 40 | #![feature(new_uninit)] |
1b1a35ee | 41 | #![feature(once_cell)] |
5e7ed085 | 42 | #![feature(let_chains)] |
f035d41b | 43 | #![feature(min_specialization)] |
0531ce1d | 44 | #![feature(trusted_len)] |
5e7ed085 | 45 | #![feature(type_alias_impl_trait)] |
416331ca | 46 | #![feature(associated_type_bounds)] |
e1599b0c | 47 | #![feature(rustc_attrs)] |
29967ef6 | 48 | #![feature(control_flow_enum)] |
fc512014 | 49 | #![feature(associated_type_defaults)] |
c295e0f8 XL |
50 | #![feature(trusted_step)] |
51 | #![feature(try_blocks)] | |
94222f64 | 52 | #![feature(try_reserve_kind)] |
136023e0 | 53 | #![feature(nonzero_ops)] |
a2a8927a | 54 | #![feature(unwrap_infallible)] |
5e7ed085 FG |
55 | #![feature(decl_macro)] |
56 | #![feature(drain_filter)] | |
04454e1e | 57 | #![feature(intra_doc_pointers)] |
923072b8 | 58 | #![feature(yeet_expr)] |
2b03887a | 59 | #![feature(result_option_inspect)] |
064997fb | 60 | #![feature(const_option)] |
dfeec247 | 61 | #![recursion_limit = "512"] |
5e7ed085 | 62 | #![allow(rustc::potential_query_instability)] |
7cac9316 | 63 | |
dfeec247 XL |
64 | #[macro_use] |
65 | extern crate bitflags; | |
66 | #[macro_use] | |
dfeec247 XL |
67 | extern crate rustc_macros; |
68 | #[macro_use] | |
69 | extern crate rustc_data_structures; | |
70 | #[macro_use] | |
3dfed10e | 71 | extern crate tracing; |
dfeec247 XL |
72 | #[macro_use] |
73 | extern crate smallvec; | |
b7449926 | 74 | |
416331ca XL |
75 | #[cfg(test)] |
76 | mod tests; | |
041b39d2 | 77 | |
9346a6ac AL |
78 | #[macro_use] |
79 | mod macros; | |
80 | ||
532ac7d7 XL |
81 | #[macro_use] |
82 | pub mod query; | |
83 | ||
48663c56 XL |
84 | #[macro_use] |
85 | pub mod arena; | |
6a06907d | 86 | #[macro_use] |
9cc50fc6 | 87 | pub mod dep_graph; |
f2b60f7d | 88 | pub(crate) mod error; |
54a0048b SL |
89 | pub mod hir; |
90 | pub mod infer; | |
91 | pub mod lint; | |
5099ac24 | 92 | pub mod metadata; |
dfeec247 | 93 | pub mod middle; |
c30ab7b3 | 94 | pub mod mir; |
17df50a5 | 95 | pub mod thir; |
54a0048b SL |
96 | pub mod traits; |
97 | pub mod ty; | |
f2b60f7d | 98 | mod values; |
1a4d82fc JJ |
99 | |
100 | pub mod util { | |
b7449926 | 101 | pub mod bug; |
dfeec247 | 102 | pub mod common; |
1a4d82fc JJ |
103 | } |
104 | ||
ba9703b0 XL |
105 | // Allows macros to refer to this crate as `::rustc_middle` |
106 | extern crate self as rustc_middle; |