DefIds are not only about CrateItem

This commit is contained in:
Santiago Pastorino 2023-07-11 17:16:44 -03:00
parent e571544f44
commit 5cf570f325
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
1 changed files with 3 additions and 8 deletions

View File

@ -147,13 +147,6 @@ pub(crate) trait Stable {
fn stable(&self) -> Self::T;
}
impl Stable for DefId {
type T = stable_mir::CrateItem;
fn stable(&self) -> Self::T {
rustc_internal::crate_item(*self)
}
}
impl<'tcx> Stable for mir::Statement<'tcx> {
type T = stable_mir::mir::Statement;
fn stable(&self) -> Self::T {
@ -188,7 +181,9 @@ impl<'tcx> Stable for mir::Rvalue<'tcx> {
Ref(region, kind, place) => {
stable_mir::mir::Rvalue::Ref(opaque(region), kind.stable(), place.stable())
}
ThreadLocalRef(def_id) => stable_mir::mir::Rvalue::ThreadLocalRef(def_id.stable()),
ThreadLocalRef(def_id) => {
stable_mir::mir::Rvalue::ThreadLocalRef(rustc_internal::crate_item(*def_id))
}
AddressOf(mutability, place) => {
stable_mir::mir::Rvalue::AddressOf(mutability.stable(), place.stable())
}