rust/compiler/rustc_middle/src/lib.rs

95 lines
2.5 KiB
Rust
Raw Normal View History

//! The "main crate" of the Rust compiler. This crate contains common
//! type definitions that are used by the other crates in the rustc
//! "family". Some prominent examples (note that each of these modules
//! has their own README with further details).
//!
//! - **HIR.** The "high-level (H) intermediate representation (IR)" is
//! defined in the `hir` module.
//! - **MIR.** The "mid-level (M) intermediate representation (IR)" is
//! defined in the `mir` module. This module contains only the
//! *definition* of the MIR; the passes that transform and operate
2020-12-20 08:32:51 +01:00
//! on MIR are found in `rustc_mir` crate.
//! - **Types.** The internal representation of types used in rustc is
//! defined in the `ty` module. This includes the **type context**
//! (or `tcx`), which is the central context during most of
//! compilation, containing the interners and other things.
//!
2020-03-05 22:07:42 +01:00
//! For more information about how rustc works, see the [rustc dev guide].
2018-02-25 22:24:14 +01:00
//!
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
2014-01-08 06:17:52 +01:00
2020-09-23 21:51:56 +02:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(array_windows)]
#![feature(backtrace)]
2019-10-08 02:14:42 +02:00
#![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(cmp_min_max_by)]
#![feature(const_fn)]
#![feature(const_panic)]
2016-06-08 23:16:35 +02:00
#![feature(core_intrinsics)]
#![feature(discriminant_kind)]
#![feature(never_type)]
2018-05-02 08:02:57 +02:00
#![feature(extern_types)]
#![feature(nll)]
#![feature(once_cell)]
#![feature(or_patterns)]
#![feature(min_specialization)]
#![feature(trusted_len)]
#![feature(test)]
#![feature(in_band_lifetimes)]
2018-08-04 02:34:23 +02:00
#![feature(crate_visibility_modifier)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
2019-12-13 05:18:21 +01:00
#![feature(int_error_matching)]
#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
#![feature(control_flow_enum)]
2020-11-05 17:30:39 +01:00
#![feature(associated_type_defaults)]
2019-12-22 23:42:04 +01:00
#![recursion_limit = "512"]
2019-12-22 23:42:04 +01:00
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
2020-08-14 08:05:01 +02:00
extern crate tracing;
2019-12-22 23:42:04 +01:00
#[macro_use]
extern crate smallvec;
2018-08-13 21:15:16 +02:00
#[cfg(test)]
mod tests;
#[macro_use]
mod macros;
2018-12-03 01:14:35 +01:00
#[macro_use]
pub mod query;
#[macro_use]
pub mod arena;
2021-01-19 19:07:06 +01:00
#[macro_use]
pub mod dep_graph;
2016-03-29 07:50:44 +02:00
pub mod hir;
pub mod ich;
pub mod infer;
pub mod lint;
2019-12-29 11:57:30 +01:00
pub mod middle;
2016-09-19 22:50:00 +02:00
pub mod mir;
pub mod traits;
pub mod ty;
pub mod util {
2019-12-22 23:42:04 +01:00
pub mod bug;
pub mod common;
2010-08-18 20:34:47 +02:00
}
// Allows macros to refer to this crate as `::rustc_middle`
2020-03-29 16:41:09 +02:00
extern crate self as rustc_middle;