Crate stable_mir

source ·
Expand description

The WIP stable interface to rustc internals.

For more information see


This API is still completely unstable and subject to change.

This crate shall contain all type definitions and APIs that we expect third-party tools to invoke to interact with the compiler.

The goal is to eventually be published on


  • pub use crate::crate_def::CrateDef;
  • pub use crate::crate_def::DefId;
  • pub use crate::error::*;


  • Define the interface with the Rust compiler.
  • Module that define a common trait for things that represent a crate definition, such as, a function, a trait, an enum, and any other definitions.
  • When things go wrong, we need some error handling. There are a few different types of errors in StableMIR:
  • Provide information about the machine that this is being compiled into.


  • Holds information about a crate.
  • Holds information about an item in a crate.
  • A type that provides internal information but that can still be used for debug purpose.



Type Aliases§