Files
rust/compiler/rustc_smir/src/rustc_internal/mod.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
446 B
Rust
Raw Normal View History

//! Module that implements the bridge between Stable MIR and internal compiler MIR.
//!
//! For that, we define APIs that will temporarily be public to 3P that exposes rustc internal APIs
//! until stable MIR is complete.
2023-03-07 12:47:25 -08:00
use crate::stable_mir;
pub use rustc_span::def_id::{CrateNum, DefId};
2023-03-07 12:47:25 -08:00
pub fn item_def_id(item: &stable_mir::CrateItem) -> DefId {
item.0
}
2023-03-07 12:47:25 -08:00
pub fn crate_num(item: &stable_mir::Crate) -> CrateNum {
item.id.into()
}