rust/compiler/rustc_middle/src/lib.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

106 lines
2.8 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
2021-01-05 19:08:11 +00:00
//! on MIR are found in `rustc_const_eval` 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 21:07:42 +00:00
//! For more information about how rustc works, see the [rustc dev guide].
2018-02-25 21:24:14 +00:00
//!
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
2014-01-08 05:17:52 +00:00
2020-09-23 19:51:56 +00:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(backtrace)]
#![feature(box_patterns)]
2016-06-08 21:16:35 +00:00
#![feature(core_intrinsics)]
2022-02-28 20:33:50 +00:00
#![cfg_attr(bootstrap, feature(derive_default_enum))]
#![feature(discriminant_kind)]
#![feature(exhaustive_patterns)]
#![feature(get_mut_unchecked)]
2021-08-16 15:29:49 +00:00
#![feature(if_let_guard)]
2021-07-18 16:12:17 +00:00
#![feature(map_first_last)]
#![feature(negative_impls)]
#![feature(never_type)]
2018-05-02 06:02:57 +00:00
#![feature(extern_types)]
#![feature(new_uninit)]
#![feature(nll)]
#![feature(once_cell)]
2022-03-23 02:25:43 +00:00
#![feature(let_chains)]
#![feature(let_else)]
#![feature(min_specialization)]
#![feature(trusted_len)]
#![feature(type_alias_impl_trait)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
#![feature(half_open_range_patterns)]
#![feature(control_flow_enum)]
2020-11-05 16:30:39 +00:00
#![feature(associated_type_defaults)]
#![feature(trusted_step)]
#![feature(try_blocks)]
#![feature(try_reserve_kind)]
#![feature(nonzero_ops)]
#![feature(unwrap_infallible)]
#![feature(decl_macro)]
#![feature(drain_filter)]
#![feature(intra_doc_pointers)]
2017-12-06 08:25:29 +00:00
#![recursion_limit = "512"]
2022-02-23 13:06:22 +00:00
#![allow(rustc::potential_query_instability)]
#[macro_use]
extern crate bitflags;
#[macro_use]
2018-12-03 00:14:35 +00:00
extern crate rustc_macros;
2017-12-06 08:25:29 +00:00
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
2020-08-14 06:05:01 +00:00
extern crate tracing;
#[macro_use]
2019-02-05 17:20:45 +00:00
extern crate smallvec;
2018-08-13 19:15:16 +00:00
#[cfg(test)]
mod tests;
#[macro_use]
mod macros;
2018-12-03 00:14:35 +00:00
#[macro_use]
pub mod query;
#[macro_use]
pub mod arena;
2021-01-19 18:07:06 +00:00
#[macro_use]
pub mod dep_graph;
2016-03-29 05:50:44 +00:00
pub mod hir;
pub mod infer;
pub mod lint;
pub mod metadata;
2019-12-29 10:57:30 +00:00
pub mod middle;
2016-09-19 20:50:00 +00:00
pub mod mir;
pub mod thir;
pub mod traits;
pub mod ty;
pub mod util {
pub mod bug;
pub mod common;
2010-08-18 18:34:47 +00:00
}
// Allows macros to refer to this crate as `::rustc_middle`
2020-03-29 14:41:09 +00:00
extern crate self as rustc_middle;