Skip to content

Commit 5cf570f

Browse files
committed
DefIds are not only about CrateItem
1 parent e571544 commit 5cf570f

File tree

1 file changed

+3
-8
lines changed
  • compiler/rustc_smir/src/rustc_smir

1 file changed

+3
-8
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ pub(crate) trait Stable {
147147
fn stable(&self) -> Self::T;
148148
}
149149

150-
impl Stable for DefId {
151-
type T = stable_mir::CrateItem;
152-
fn stable(&self) -> Self::T {
153-
rustc_internal::crate_item(*self)
154-
}
155-
}
156-
157150
impl<'tcx> Stable for mir::Statement<'tcx> {
158151
type T = stable_mir::mir::Statement;
159152
fn stable(&self) -> Self::T {
@@ -188,7 +181,9 @@ impl<'tcx> Stable for mir::Rvalue<'tcx> {
188181
Ref(region, kind, place) => {
189182
stable_mir::mir::Rvalue::Ref(opaque(region), kind.stable(), place.stable())
190183
}
191-
ThreadLocalRef(def_id) => stable_mir::mir::Rvalue::ThreadLocalRef(def_id.stable()),
184+
ThreadLocalRef(def_id) => {
185+
stable_mir::mir::Rvalue::ThreadLocalRef(rustc_internal::crate_item(*def_id))
186+
}
192187
AddressOf(mutability, place) => {
193188
stable_mir::mir::Rvalue::AddressOf(mutability.stable(), place.stable())
194189
}

0 commit comments

Comments
 (0)