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§
- Data structures for memoizing computations.
- Utilities for HIR-level data structures.
- Utilities for MIR-level data structures.
- Utilities for source-mapping text ranges to program elements.
- A simple timer for profiling.
Macros§
- Logs the time taken from the start to the end of a syntactic block.
- Utility for hashset literals. Same as
maplit::hashset
but works withFxHasher
.