Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/from_id.rs')
-rw-r--r--crates/hir/src/from_id.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/hir/src/from_id.rs b/crates/hir/src/from_id.rs
index fc20f4b46b..1aeed874af 100644
--- a/crates/hir/src/from_id.rs
+++ b/crates/hir/src/from_id.rs
@@ -4,8 +4,8 @@
//! are splitting the hir.
use hir_def::{
- AdtId, AssocItemId, BuiltinDeriveImplId, DefWithBodyId, EnumVariantId, FieldId, GenericDefId,
- GenericParamId, ModuleDefId, VariantId,
+ AdtId, AssocItemId, BuiltinDeriveImplId, DefWithBodyId, EnumVariantId, ExpressionStoreOwnerId,
+ FieldId, GenericDefId, GenericParamId, ModuleDefId, VariantId,
hir::{BindingId, LabelId},
};
use hir_ty::next_solver::AnyImplId;
@@ -255,14 +255,19 @@ impl TryFrom<AssocItem> for GenericDefId {
}
}
+impl From<(ExpressionStoreOwnerId, BindingId)> for Local {
+ fn from((parent, binding_id): (ExpressionStoreOwnerId, BindingId)) -> Self {
+ Local { parent, binding_id }
+ }
+}
impl From<(DefWithBodyId, BindingId)> for Local {
fn from((parent, binding_id): (DefWithBodyId, BindingId)) -> Self {
- Local { parent, binding_id }
+ Local { parent: parent.into(), binding_id }
}
}
-impl From<(DefWithBodyId, LabelId)> for Label {
- fn from((parent, label_id): (DefWithBodyId, LabelId)) -> Self {
+impl From<(ExpressionStoreOwnerId, LabelId)> for Label {
+ fn from((parent, label_id): (ExpressionStoreOwnerId, LabelId)) -> Self {
Label { parent, label_id }
}
}