]> git.lizzy.rs Git - rust.git/blob - src/librustc_middle/lib.rs
Rollup merge of #72026 - botika:master, r=estebank
[rust.git] / src / librustc_middle / 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 `librustc_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/")]
26 #![feature(backtrace)]
27 #![feature(bool_to_option)]
28 #![feature(box_patterns)]
29 #![feature(box_syntax)]
30 #![feature(const_if_match)]
31 #![feature(const_fn)]
32 #![feature(const_panic)]
33 #![feature(const_transmute)]
34 #![feature(core_intrinsics)]
35 #![feature(discriminant_kind)]
36 #![feature(drain_filter)]
37 #![feature(never_type)]
38 #![feature(exhaustive_patterns)]
39 #![feature(marker_trait_attr)]
40 #![feature(extern_types)]
41 #![feature(nll)]
42 #![feature(option_expect_none)]
43 #![feature(or_patterns)]
44 #![feature(range_is_empty)]
45 #![feature(specialization)] // FIXME: min_specialization does not work
46 #![feature(track_caller)]
47 #![feature(trusted_len)]
48 #![feature(vec_remove_item)]
49 #![feature(stmt_expr_attributes)]
50 #![feature(test)]
51 #![feature(in_band_lifetimes)]
52 #![feature(crate_visibility_modifier)]
53 #![feature(associated_type_bounds)]
54 #![feature(rustc_attrs)]
55 #![feature(hash_raw_entry)]
56 #![feature(int_error_matching)]
57 #![recursion_limit = "512"]
58
59 #[macro_use]
60 extern crate bitflags;
61 #[macro_use]
62 extern crate scoped_tls;
63 #[macro_use]
64 extern crate rustc_macros;
65 #[macro_use]
66 extern crate rustc_data_structures;
67 #[macro_use]
68 extern crate log;
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 pub mod dep_graph;
84 pub mod hir;
85 pub mod ich;
86 pub mod infer;
87 pub mod lint;
88 pub mod middle;
89 pub mod mir;
90 pub mod traits;
91 pub mod ty;
92
93 pub mod util {
94     pub mod bug;
95     pub mod common;
96 }
97
98 // Allows macros to refer to this crate as `::rustc_middle`
99 extern crate self as rustc_middle;