Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/def_id.rs')
-rw-r--r--crates/hir-ty/src/next_solver/def_id.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/hir-ty/src/next_solver/def_id.rs b/crates/hir-ty/src/next_solver/def_id.rs
index e76ab16fc2..f725af320d 100644
--- a/crates/hir-ty/src/next_solver/def_id.rs
+++ b/crates/hir-ty/src/next_solver/def_id.rs
@@ -2,8 +2,8 @@
use hir_def::{
AdtId, AnonConstId, AttrDefId, BuiltinDeriveImplId, CallableDefId, ConstId, DefWithBodyId,
- EnumId, EnumVariantId, FunctionId, GeneralConstId, GenericDefId, ImplId, StaticId, StructId,
- TraitId, TypeAliasId, UnionId,
+ EnumId, EnumVariantId, ExpressionStoreOwner, FunctionId, GeneralConstId, GenericDefId, ImplId,
+ StaticId, StructId, TraitId, TypeAliasId, UnionId,
};
use rustc_type_ir::inherent;
use stdx::impl_from;
@@ -12,13 +12,13 @@ use crate::db::{InternedClosureId, InternedCoroutineId, InternedOpaqueTyId};
use super::DbInterner;
-#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Supertype)]
+#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Ctor {
Struct(StructId),
Enum(EnumVariantId),
}
-#[derive(PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Supertype)]
+#[derive(PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash)]
pub enum SolverDefId {
AdtId(AdtId),
ConstId(ConstId),
@@ -33,7 +33,6 @@ pub enum SolverDefId {
InternedCoroutineId(InternedCoroutineId),
InternedOpaqueTyId(InternedOpaqueTyId),
EnumVariantId(EnumVariantId),
- // FIXME(next-solver): Do we need the separation of `Ctor`? It duplicates some variants.
Ctor(Ctor),
}
@@ -139,6 +138,15 @@ impl From<GenericDefId> for SolverDefId {
}
}
+impl From<ExpressionStoreOwner> for SolverDefId {
+ fn from(value: ExpressionStoreOwner) -> Self {
+ match value {
+ ExpressionStoreOwner::Signature(generic_def_id) => generic_def_id.into(),
+ ExpressionStoreOwner::Body(def_with_body_id) => def_with_body_id.into(),
+ }
+ }
+}
+
impl From<GeneralConstId> for SolverDefId {
#[inline]
fn from(value: GeneralConstId) -> Self {