rust/src/librustc/lib.rs

94 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
//! on MIR are found in `librustc_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 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
//!
2020-03-05 18:07:42 -03:00
//! [rustc dev guide]: https://rust-lang.github.io/rustc-dev-guide/
//!
//! # Note
//!
//! This API is completely unstable and subject to change.
2014-01-07 21:17:52 -08:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
2019-10-08 01:14:42 +01:00
#![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(const_transmute)]
2016-06-09 00:16:35 +03:00
#![feature(core_intrinsics)]
2017-12-06 09:25:29 +01:00
#![feature(drain_filter)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
#![feature(marker_trait_attr)]
2018-05-02 08:02:57 +02:00
#![feature(extern_types)]
#![feature(nll)]
#![feature(option_expect_none)]
2019-03-21 12:37:31 +00:00
#![feature(range_is_empty)]
#![feature(specialization)]
#![feature(trusted_len)]
#![feature(vec_remove_item)]
2018-12-04 16:26:34 +01:00
#![feature(stmt_expr_attributes)]
#![feature(test)]
#![feature(in_band_lifetimes)]
2018-08-03 18:34:23 -06:00
#![feature(crate_visibility_modifier)]
#![feature(associated_type_bounds)]
#![feature(rustc_attrs)]
#![feature(hash_raw_entry)]
2019-12-12 21:18:21 -07:00
#![feature(int_error_matching)]
2019-12-22 17:42:04 -05:00
#![recursion_limit = "512"]
2019-12-22 17:42:04 -05:00
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate scoped_tls;
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
extern crate log;
#[macro_use]
extern crate smallvec;
2018-08-13 22:15:16 +03: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;
pub mod dep_graph;
2016-03-29 08:50:44 +03: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 23:50:00 +03:00
pub mod mir;
2019-11-29 16:05:28 -05:00
pub use rustc_session as session;
pub mod traits;
pub mod ty;
pub mod util {
2019-12-22 17:42:04 -05:00
pub mod bug;
pub mod common;
2010-08-18 11:34:47 -07:00
}
2019-03-05 19:27:50 +01:00
// Allows macros to refer to this crate as `::rustc`
extern crate self as rustc;