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§

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.
  • Running rustc and Flowistry in tests.
  • 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 with FxHasher.