]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/lib.rs
Auto merge of #83267 - ssomers:btree_prune_range_search_overlap, r=Mark-Simulacrum
[rust.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 #![cfg_attr(bootstrap, 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 #![feature(iter_zip)]
55 #![recursion_limit = "512"]
56
57 #[macro_use]
58 extern crate bitflags;
59 #[macro_use]
60 extern crate rustc_macros;
61 #[macro_use]
62 extern crate rustc_data_structures;
63 #[macro_use]
64 extern crate tracing;
65 #[macro_use]
66 extern crate smallvec;
67
68 #[cfg(test)]
69 mod tests;
70
71 #[macro_use]
72 mod macros;
73
74 #[macro_use]
75 pub mod query;
76
77 #[macro_use]
78 pub mod arena;
79 #[macro_use]
80 pub mod dep_graph;
81 pub mod hir;
82 pub mod ich;
83 pub mod infer;
84 pub mod lint;
85 pub mod middle;
86 pub mod mir;
87 pub mod traits;
88 pub mod ty;
89
90 pub mod util {
91     pub mod bug;
92     pub mod common;
93 }
94
95 // Allows macros to refer to this crate as `::rustc_middle`
96 extern crate self as rustc_middle;