]> git.lizzy.rs Git - rust.git/blob - src/librustc/lib.rs
Rollup merge of #69766 - skade:make-point-copy-in-add-documentation, r=shepmaster
[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 //!
17 //! For more information about how rustc works, see the [rustc guide].
18 //!
19 //! [rustc guide]: https://rust-lang.github.io/rustc-guide/
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_transmute)]
30 #![feature(core_intrinsics)]
31 #![feature(drain_filter)]
32 #![feature(never_type)]
33 #![feature(exhaustive_patterns)]
34 #![feature(marker_trait_attr)]
35 #![feature(extern_types)]
36 #![feature(nll)]
37 #![feature(option_expect_none)]
38 #![feature(range_is_empty)]
39 #![feature(specialization)]
40 #![feature(trusted_len)]
41 #![feature(vec_remove_item)]
42 #![feature(stmt_expr_attributes)]
43 #![feature(test)]
44 #![feature(in_band_lifetimes)]
45 #![feature(crate_visibility_modifier)]
46 #![feature(associated_type_bounds)]
47 #![feature(rustc_attrs)]
48 #![feature(hash_raw_entry)]
49 #![feature(int_error_matching)]
50 #![recursion_limit = "512"]
51
52 #[macro_use]
53 extern crate bitflags;
54 #[macro_use]
55 extern crate scoped_tls;
56 #[macro_use]
57 extern crate rustc_macros;
58 #[macro_use]
59 extern crate rustc_data_structures;
60 #[macro_use]
61 extern crate log;
62 #[macro_use]
63 extern crate smallvec;
64
65 #[cfg(test)]
66 mod tests;
67
68 #[macro_use]
69 mod macros;
70
71 #[macro_use]
72 pub mod query;
73
74 #[macro_use]
75 pub mod arena;
76 pub mod dep_graph;
77 pub mod hir;
78 pub mod ich;
79 pub mod infer;
80 pub mod lint;
81 pub mod middle;
82 pub mod mir;
83 pub use rustc_session as session;
84 pub mod traits;
85 pub mod ty;
86
87 pub mod util {
88     pub mod bug;
89     pub mod common;
90 }
91
92 // Allows macros to refer to this crate as `::rustc`
93 extern crate self as rustc;