rust/compiler/rustc_middle/src/lib.rs

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

113 lines
3.0 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 13:08:11 -06: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 15:07:42 -06:00
//! For more information about how rustc works, see the [rustc dev guide].
2018-02-25 15:24:14 -06:00
//!
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
2014-01-07 23:17:52 -06:00
2020-09-23 14:51:56 -05:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(box_patterns)]
2016-06-08 16:16:35 -05:00
#![feature(core_intrinsics)]
#![feature(discriminant_kind)]
#![feature(exhaustive_patterns)]
#![feature(generators)]
#![feature(get_mut_unchecked)]
2021-08-16 10:29:49 -05:00
#![feature(if_let_guard)]
2023-03-26 04:22:21 -05:00
#![feature(inline_const)]
#![feature(iter_from_generator)]
2023-02-07 23:24:57 -06:00
#![feature(local_key_cell_methods)]
#![feature(negative_impls)]
#![feature(never_type)]
2018-05-02 01:02:57 -05:00
#![feature(extern_types)]
#![feature(new_uninit)]
#![feature(let_chains)]
#![feature(min_specialization)]
#![feature(trusted_len)]
#![feature(type_alias_impl_trait)]
2022-12-31 04:43:40 -06:00
#![feature(strict_provenance)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
#![feature(control_flow_enum)]
#![feature(trusted_step)]
#![feature(try_blocks)]
#![feature(try_reserve_kind)]
#![feature(nonzero_ops)]
#![feature(decl_macro)]
#![feature(drain_filter)]
#![feature(intra_doc_pointers)]
2022-05-29 03:19:52 -05:00
#![feature(yeet_expr)]
#![feature(result_option_inspect)]
#![feature(const_option)]
#![feature(trait_alias)]
2017-12-06 02:25:29 -06:00
#![recursion_limit = "512"]
2022-02-23 07:06:22 -06:00
#![allow(rustc::potential_query_instability)]
#[macro_use]
extern crate bitflags;
#[macro_use]
2018-12-02 18:14:35 -06:00
extern crate rustc_macros;
2017-12-06 02:25:29 -06:00
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
2020-08-14 01:05:01 -05:00
extern crate tracing;
#[macro_use]
2019-02-05 11:20:45 -06:00
extern crate smallvec;
2018-08-13 14:15:16 -05:00
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
use rustc_macros::fluent_messages;
#[cfg(test)]
mod tests;
#[macro_use]
mod macros;
2018-12-02 18:14:35 -06:00
#[macro_use]
pub mod query;
#[macro_use]
pub mod arena;
2021-01-19 12:07:06 -06:00
#[macro_use]
pub mod dep_graph;
2022-08-25 22:24:09 -05:00
pub(crate) mod error;
2016-03-29 00:50:44 -05:00
pub mod hir;
pub mod infer;
pub mod lint;
pub mod metadata;
2019-12-29 04:57:30 -06:00
pub mod middle;
2016-09-19 15:50:00 -05:00
pub mod mir;
pub mod thir;
pub mod traits;
pub mod ty;
mod values;
pub mod util {
pub mod bug;
pub mod common;
2010-08-18 13:34:47 -05:00
}
// Allows macros to refer to this crate as `::rustc_middle`
2020-03-29 09:41:09 -05:00
extern crate self as rustc_middle;
fluent_messages! { "../messages.ftl" }