]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
Auto merge of #67596 - Mark-Simulacrum:tidy-silence-rustfmt, r=Centril
[rust.git] / src / librustc / 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 //! - **Traits.** Trait resolution is implemented in the `traits` module.
17 //! - **Type inference.** The type inference code can be found in the `infer` module;
18 //!   this code handles low-level equality and subtyping operations. The
19 //!   type check pass in the compiler is found in the `librustc_typeck` crate.
20 //!
21 //! For more information about how rustc works, see the [rustc guide].
22 //!
23 //! [rustc guide]: https://rust-lang.github.io/rustc-guide/
24 //!
25 //! # Note
26 //!
27 //! This API is completely unstable and subject to change.
28
29 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
30 #![feature(arbitrary_self_types)]
31 #![feature(bool_to_option)]
32 #![feature(box_patterns)]
33 #![feature(box_syntax)]
34 #![feature(const_fn)]
35 #![feature(const_transmute)]
36 #![feature(core_intrinsics)]
37 #![feature(drain_filter)]
38 #![cfg_attr(windows, feature(libc))]
39 #![feature(never_type)]
40 #![feature(exhaustive_patterns)]
41 #![feature(overlapping_marker_traits)]
42 #![feature(extern_types)]
43 #![feature(nll)]
44 #![feature(optin_builtin_traits)]
45 #![feature(option_expect_none)]
46 #![feature(range_is_empty)]
47 #![feature(slice_patterns)]
48 #![feature(specialization)]
49 #![feature(unboxed_closures)]
50 #![feature(thread_local)]
51 #![feature(trace_macros)]
52 #![feature(trusted_len)]
53 #![feature(vec_remove_item)]
54 #![feature(stmt_expr_attributes)]
55 #![feature(integer_atomics)]
56 #![feature(test)]
57 #![feature(in_band_lifetimes)]
58 #![feature(crate_visibility_modifier)]
59 #![feature(log_syntax)]
60 #![feature(associated_type_bounds)]
61 #![feature(rustc_attrs)]
62 #![feature(hash_raw_entry)]
63 #![recursion_limit = "512"]
64
65 #[macro_use]
66 extern crate bitflags;
67 #[macro_use]
68 extern crate scoped_tls;
69 #[cfg(windows)]
70 extern crate libc;
71 #[macro_use]
72 extern crate rustc_macros;
73 #[macro_use]
74 extern crate rustc_data_structures;
75 #[macro_use]
76 extern crate log;
77 #[macro_use]
78 extern crate syntax;
79 #[macro_use]
80 extern crate smallvec;
81
82 #[cfg(test)]
83 mod tests;
84
85 #[macro_use]
86 mod macros;
87
88 #[macro_use]
89 pub mod query;
90
91 #[macro_use]
92 pub mod arena;
93 pub mod dep_graph;
94 pub mod hir;
95 pub mod ich;
96 pub mod infer;
97 pub mod lint;
98
99 pub mod middle {
100     pub mod cstore;
101     pub mod dependency_format;
102     pub mod diagnostic_items;
103     pub mod exported_symbols;
104     pub mod free_region;
105     pub mod lang_items;
106     pub mod lib_features;
107     pub mod privacy;
108     pub mod reachable;
109     pub mod recursion_limit;
110     pub mod region;
111     pub mod resolve_lifetime;
112     pub mod stability;
113     pub mod weak_lang_items;
114 }
115
116 pub mod mir;
117 pub use rustc_session as session;
118 pub mod traits;
119 pub mod ty;
120
121 pub mod util {
122     pub mod bug;
123     pub mod captures;
124     pub mod common;
125     pub mod nodemap;
126 }
127
128 // Allows macros to refer to this crate as `::rustc`
129 extern crate self as rustc;