]> git.lizzy.rs Git - rust.git/blob - src/librustc_middle/lib.rs
Rollup merge of #71459 - divergentdave:pointer-offset-0x, r=RalfJung
[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(bool_to_option)]
27 #![feature(box_patterns)]
28 #![feature(box_syntax)]
29 #![feature(const_if_match)]
30 #![feature(const_fn)]
31 #![feature(const_panic)]
32 #![feature(const_transmute)]
33 #![feature(core_intrinsics)]
34 #![feature(drain_filter)]
35 #![feature(never_type)]
36 #![feature(exhaustive_patterns)]
37 #![feature(marker_trait_attr)]
38 #![feature(extern_types)]
39 #![feature(nll)]
40 #![feature(option_expect_none)]
41 #![feature(or_patterns)]
42 #![feature(range_is_empty)]
43 #![feature(specialization)]
44 #![feature(trusted_len)]
45 #![feature(vec_remove_item)]
46 #![feature(stmt_expr_attributes)]
47 #![feature(test)]
48 #![feature(in_band_lifetimes)]
49 #![feature(crate_visibility_modifier)]
50 #![feature(associated_type_bounds)]
51 #![feature(rustc_attrs)]
52 #![feature(hash_raw_entry)]
53 #![feature(int_error_matching)]
54 #![recursion_limit = "512"]
55
56 #[macro_use]
57 extern crate bitflags;
58 #[macro_use]
59 extern crate scoped_tls;
60 #[macro_use]
61 extern crate rustc_macros;
62 #[macro_use]
63 extern crate rustc_data_structures;
64 #[macro_use]
65 extern crate log;
66 #[macro_use]
67 extern crate smallvec;
68
69 #[cfg(test)]
70 mod tests;
71
72 #[macro_use]
73 mod macros;
74
75 #[macro_use]
76 pub mod query;
77
78 #[macro_use]
79 pub mod arena;
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;