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