]> git.lizzy.rs Git - rust.git/blob - src/librustc_middle/lib.rs
Update cargo
[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_fn)]
31 #![feature(const_panic)]
32 #![feature(const_fn_transmute)]
33 #![feature(core_intrinsics)]
34 #![feature(discriminant_kind)]
35 #![feature(drain_filter)]
36 #![feature(never_type)]
37 #![feature(exhaustive_patterns)]
38 #![feature(extern_types)]
39 #![feature(nll)]
40 #![feature(option_expect_none)]
41 #![feature(or_patterns)]
42 #![feature(range_is_empty)]
43 #![feature(min_specialization)]
44 #![feature(trusted_len)]
45 #![feature(stmt_expr_attributes)]
46 #![feature(test)]
47 #![feature(in_band_lifetimes)]
48 #![feature(crate_visibility_modifier)]
49 #![feature(associated_type_bounds)]
50 #![feature(rustc_attrs)]
51 #![feature(hash_raw_entry)]
52 #![feature(int_error_matching)]
53 #![recursion_limit = "512"]
54
55 #[macro_use]
56 extern crate bitflags;
57 #[macro_use]
58 extern crate scoped_tls;
59 #[macro_use]
60 extern crate rustc_macros;
61 #[macro_use]
62 extern crate rustc_data_structures;
63 #[macro_use]
64 extern crate log;
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 pub mod dep_graph;
80 pub mod hir;
81 pub mod ich;
82 pub mod infer;
83 pub mod lint;
84 pub mod middle;
85 pub mod mir;
86 pub mod traits;
87 pub mod ty;
88
89 pub mod util {
90     pub mod bug;
91     pub mod common;
92 }
93
94 // Allows macros to refer to this crate as `::rustc_middle`
95 extern crate self as rustc_middle;