rust/compiler/rustc_middle/src/lib.rs

100 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**][ty::TyCtxt] (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
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::potential_query_instability)]
#![allow(rustc::untranslatable_diagnostic)]
2020-09-23 19:51:56 +00:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2023-11-13 12:39:17 +00:00
#![doc(rust_logo)]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(associated_type_defaults)]
#![feature(box_as_ptr)]
#![feature(box_patterns)]
2024-03-12 13:49:50 +00:00
#![feature(closure_track_caller)]
2024-02-07 07:47:52 +00:00
#![feature(const_type_name)]
#![feature(core_intrinsics)]
2023-11-13 12:39:17 +00:00
#![feature(coroutines)]
#![feature(decl_macro)]
#![feature(discriminant_kind)]
#![feature(extern_types)]
#![feature(extract_if)]
2024-09-24 21:25:16 +00:00
#![feature(file_buffered)]
2021-08-16 15:29:49 +00:00
#![feature(if_let_guard)]
#![feature(intra_doc_pointers)]
2023-10-19 21:46:28 +00:00
#![feature(iter_from_coroutine)]
#![feature(let_chains)]
#![feature(macro_metavar_expr)]
#![feature(min_specialization)]
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(ptr_alignment_type)]
#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
#![feature(trait_upcasting)]
#![feature(trusted_len)]
#![feature(try_blocks)]
#![feature(try_trait_v2)]
#![feature(try_trait_v2_yeet)]
#![feature(type_alias_impl_trait)]
2022-05-29 08:19:52 +00:00
#![feature(yeet_expr)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end
#[cfg(test)]
mod tests;
#[macro_use]
mod macros;
#[macro_use]
pub mod arena;
pub mod error;
2016-03-29 05:50:44 +00:00
pub mod hir;
pub mod hooks;
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;
mod values;
#[macro_use]
pub mod query;
#[macro_use]
pub mod dep_graph;
// Allows macros to refer to this crate as `::rustc_middle`
2020-03-29 14:41:09 +00:00
extern crate self as rustc_middle;
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }