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).
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.
17 //! For more information about how rustc works, see the [rustc dev guide].
19 //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
23 //! This API is completely unstable and subject to change.
25 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
26 #![feature(array_windows)]
27 #![feature(assoc_char_funcs)]
28 #![feature(backtrace)]
29 #![feature(bool_to_option)]
30 #![feature(box_patterns)]
31 #![feature(box_syntax)]
32 #![feature(cmp_min_max_by)]
34 #![feature(const_panic)]
35 #![feature(core_intrinsics)]
36 #![feature(discriminant_kind)]
37 #![feature(never_type)]
38 #![feature(extern_types)]
40 #![feature(once_cell)]
41 #![feature(option_expect_none)]
42 #![feature(or_patterns)]
43 #![feature(min_specialization)]
44 #![feature(trusted_len)]
46 #![feature(in_band_lifetimes)]
47 #![feature(crate_visibility_modifier)]
48 #![feature(associated_type_bounds)]
49 #![feature(rustc_attrs)]
50 #![feature(int_error_matching)]
51 #![feature(half_open_range_patterns)]
52 #![feature(exclusive_range_pattern)]
53 #![feature(control_flow_enum)]
54 #![feature(associated_type_defaults)]
55 #![recursion_limit = "512"]
58 extern crate bitflags;
60 extern crate rustc_macros;
62 extern crate rustc_data_structures;
66 extern crate smallvec;
94 // Allows macros to refer to this crate as `::rustc_middle`
95 extern crate self as rustc_middle;