Crate rustc_utils

Source
Expand description

rustc_utils provides a wide variety of utilities for working with the Rust compiler. We developed these functions in the course of building various research projects with rustc.

Most of the functionality is organized into extension traits implemented for types in the compiler, such as one for MIR control-flow graphs (BodyExt) or one for text ranges (SpanExt).

This crate is pinned to a specific nightly version of the Rust compiler. See the rustc_plugin README for details on how to add rustc_utils as a dependency.

Re-exports§

pub use crate::hir::ty::TyExt;
pub use crate::mir::adt_def::AdtDefExt;
pub use crate::mir::body::BodyExt;
pub use crate::mir::mutability::MutabilityExt;
pub use crate::mir::operand::OperandExt;
pub use crate::mir::place::PlaceExt;
pub use crate::source_map::span::SpanDataExt;
pub use crate::source_map::span::SpanExt;

Modules§

cache
Data structures for memoizing computations.
hir
Utilities for HIR-level data structures.
mir
Utilities for MIR-level data structures.
source_map
Utilities for source-mapping text ranges to program elements.
timer
A simple timer for profiling.

Macros§

block_timer
Logs the time taken from the start to the end of a syntactic block.
hashset
Utility for hashset literals. Same as maplit::hashset but works with FxHasher.