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 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 20:08:11 +01: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 18:07:42 -03: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 21:17:52 -08:00
2020-09-23 21:51:56 +02:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2023-11-13 07:39:17 -05:00
#![doc(rust_logo)]
#![feature(rustdoc_internals)]
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(box_patterns)]
2016-06-09 00:16:35 +03:00
#![feature(core_intrinsics)]
#![feature(discriminant_kind)]
#![feature(exhaustive_patterns)]
2023-11-13 07:39:17 -05:00
#![feature(coroutines)]
#![feature(get_mut_unchecked)]
2021-08-16 17:29:49 +02:00
#![feature(if_let_guard)]
2023-03-26 11:22:21 +02:00
#![feature(inline_const)]
2023-10-19 21:46:28 +00:00
#![feature(iter_from_coroutine)]
#![feature(negative_impls)]
#![feature(never_type)]
2018-05-02 08:02:57 +02:00
#![feature(extern_types)]
#![feature(new_uninit)]
#![feature(let_chains)]
#![feature(min_specialization)]
#![feature(trusted_len)]
#![feature(type_alias_impl_trait)]
2022-12-31 11:43:40 +01:00
#![feature(strict_provenance)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
#![feature(control_flow_enum)]
#![cfg_attr(bootstrap, feature(trait_upcasting))]
#![feature(trusted_step)]
#![feature(try_blocks)]
#![feature(try_reserve_kind)]
#![feature(nonzero_ops)]
#![feature(decl_macro)]
#![feature(extract_if)]
#![feature(intra_doc_pointers)]
2022-05-29 01:19:52 -07:00
#![feature(yeet_expr)]
#![feature(const_option)]
#![feature(trait_alias)]
#![feature(ptr_alignment_type)]
#![feature(macro_metavar_expr)]
2017-12-06 09:25:29 +01:00
#![recursion_limit = "512"]
2022-02-23 08:06:22 -05:00
#![allow(rustc::potential_query_instability)]
2023-08-22 07:06:38 -04:00
#![allow(internal_features)]
#[macro_use]
extern crate bitflags;
#[macro_use]
2018-12-03 01:14:35 +01:00
extern crate rustc_macros;
2017-12-06 09:25:29 +01:00
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
2020-08-13 23:05:01 -07:00
extern crate tracing;
#[macro_use]
2019-02-05 11:20:45 -06:00
extern crate smallvec;
2018-08-13 22:15:16 +03:00
use rustc_fluent_macro::fluent_messages;
#[cfg(test)]
mod tests;
#[macro_use]
mod macros;
#[macro_use]
pub mod arena;
pub mod error;
2016-03-29 08:50:44 +03:00
pub mod hir;
pub mod hooks;
pub mod infer;
pub mod lint;
pub mod metadata;
2019-12-29 11:57:30 +01:00
pub mod middle;
2016-09-19 23:50:00 +03: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 16:41:09 +02:00
extern crate self as rustc_middle;
fluent_messages! { "../messages.ftl" }