#[repr(C)]
pub struct DefIdLayout {
pub krate: u32,
pub index: u32,
}
#[repr(C)]
pub struct BodyIdLayout {
pub owner: u32,
pub index: u32,
}
pub struct DefIdInfo {
pub index: u32,
pub krate: u32,
}
#[repr(C)]
pub struct HirIdLayout {
pub owner: u32,
pub index: u32,
}
#[repr(C)]
pub struct ExpnIdLayout {
pub krate: u32,
pub index: u32,
}
#[macro_export]
macro_rules! transmute_id {
($t1:ty as $t2:ty = $e:expr) => {
{
assert_eq!(size_of::<$t1>(), size_of::<$t2>(), "the layout is invalid");
unsafe { transmute::<$t1, $t2>($e) }
}
};
}