]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_middle/src/lib.rs
Do not suggest using a const parameter when there are bounds on an unused type parameter
[rust.git] / compiler / rustc_middle / src / 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 `rustc_const_eval` 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/nightly-rustc/")]
26 #![feature(allocator_api)]
27 #![feature(array_windows)]
28 #![feature(assert_matches)]
29 #![feature(backtrace)]
30 #![feature(bool_to_option)]
31 #![feature(box_patterns)]
32 #![feature(core_intrinsics)]
33 #![feature(derive_default_enum)]
34 #![feature(discriminant_kind)]
35 #![feature(exhaustive_patterns)]
36 #![feature(get_mut_unchecked)]
37 #![feature(if_let_guard)]
38 #![feature(map_first_last)]
39 #![feature(never_type)]
40 #![feature(extern_types)]
41 #![feature(new_uninit)]
42 #![feature(nll)]
43 #![feature(once_cell)]
44 #![feature(let_else)]
45 #![feature(min_specialization)]
46 #![feature(trusted_len)]
47 #![feature(crate_visibility_modifier)]
48 #![feature(associated_type_bounds)]
49 #![feature(rustc_attrs)]
50 #![feature(half_open_range_patterns)]
51 #![feature(control_flow_enum)]
52 #![feature(associated_type_defaults)]
53 #![feature(trusted_step)]
54 #![feature(try_blocks)]
55 #![feature(try_reserve_kind)]
56 #![feature(nonzero_ops)]
57 #![feature(unwrap_infallible)]
58 #![feature(decl_macro)]
59 #![recursion_limit = "512"]
60 #![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
61
62 #[macro_use]
63 extern crate bitflags;
64 #[macro_use]
65 extern crate rustc_macros;
66 #[macro_use]
67 extern crate rustc_data_structures;
68 #[macro_use]
69 extern crate tracing;
70 #[macro_use]
71 extern crate smallvec;
72
73 #[cfg(test)]
74 mod tests;
75
76 #[macro_use]
77 mod macros;
78
79 #[macro_use]
80 pub mod query;
81
82 #[macro_use]
83 pub mod arena;
84 #[macro_use]
85 pub mod dep_graph;
86 pub mod hir;
87 pub mod infer;
88 pub mod lint;
89 pub mod metadata;
90 pub mod middle;
91 pub mod mir;
92 pub mod thir;
93 pub mod traits;
94 pub mod ty;
95
96 pub mod util {
97     pub mod bug;
98     pub mod common;
99 }
100
101 // Allows macros to refer to this crate as `::rustc_middle`
102 extern crate self as rustc_middle;