]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
Do not ICE on multipart suggestions touching multiple files
[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_transmute)]
35 #![feature(core_intrinsics)]
36 #![feature(drain_filter)]
37 #![feature(never_type)]
38 #![feature(exhaustive_patterns)]
39 #![feature(overlapping_marker_traits)]
40 #![feature(extern_types)]
41 #![feature(nll)]
42 #![feature(optin_builtin_traits)]
43 #![feature(option_expect_none)]
44 #![feature(range_is_empty)]
45 #![cfg_attr(bootstrap, feature(slice_patterns))]
46 #![feature(specialization)]
47 #![feature(unboxed_closures)]
48 #![feature(thread_local)]
49 #![feature(trace_macros)]
50 #![feature(trusted_len)]
51 #![feature(vec_remove_item)]
52 #![feature(stmt_expr_attributes)]
53 #![feature(integer_atomics)]
54 #![feature(test)]
55 #![feature(in_band_lifetimes)]
56 #![feature(crate_visibility_modifier)]
57 #![feature(log_syntax)]
58 #![feature(associated_type_bounds)]
59 #![feature(rustc_attrs)]
60 #![feature(hash_raw_entry)]
61 #![recursion_limit = "512"]
62
63 #[macro_use]
64 extern crate bitflags;
65 #[macro_use]
66 extern crate scoped_tls;
67 #[macro_use]
68 extern crate rustc_macros;
69 #[macro_use]
70 extern crate rustc_data_structures;
71 #[macro_use]
72 extern crate log;
73 #[macro_use]
74 extern crate smallvec;
75
76 #[cfg(test)]
77 mod tests;
78
79 #[macro_use]
80 mod macros;
81
82 #[macro_use]
83 pub mod query;
84
85 #[macro_use]
86 pub mod arena;
87 pub mod dep_graph;
88 pub mod hir;
89 pub mod ich;
90 pub mod infer;
91 pub mod lint;
92 pub mod middle;
93 pub mod mir;
94 pub use rustc_session as session;
95 pub mod traits;
96 pub mod ty;
97
98 pub mod util {
99     pub mod bug;
100     pub mod common;
101 }
102
103 // Allows macros to refer to this crate as `::rustc`
104 extern crate self as rustc;