Skip to content

Commit b598ab8

Browse files
committed
Rename CallableDefId -> InternedCallabelDefid
1 parent 8a88023 commit b598ab8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

crates/ra_hir_ty/src/db.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
7777

7878
// Interned IDs for Chalk integration
7979
#[salsa::interned]
80-
fn intern_callable_def(&self, callable_def: CallableDef) -> crate::CallableDefId;
80+
fn intern_callable_def(&self, callable_def: CallableDef) -> InternedCallableDefId;
8181
#[salsa::interned]
8282
fn intern_type_param_id(&self, param_id: TypeParamId) -> GlobalTypeParamId;
8383
#[salsa::interned]
@@ -151,3 +151,9 @@ impl_intern_key!(InternedOpaqueTyId);
151151
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
152152
pub struct ClosureId(salsa::InternId);
153153
impl_intern_key!(ClosureId);
154+
155+
/// This exists just for Chalk, because Chalk just has a single `FnDefId` where
156+
/// we have different IDs for struct and enum variant constructors.
157+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
158+
pub struct InternedCallableDefId(salsa::InternId);
159+
impl_intern_key!(InternedCallableDefId);

crates/ra_hir_ty/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use hir_def::{
3333
TypeParamId,
3434
};
3535
use itertools::Itertools;
36-
use ra_db::{impl_intern_key, salsa, CrateId};
36+
use ra_db::{salsa, CrateId};
3737

3838
use crate::{
3939
db::HirDatabase,
@@ -140,12 +140,6 @@ pub enum TypeCtor {
140140
Closure { def: DefWithBodyId, expr: ExprId },
141141
}
142142

143-
/// This exists just for Chalk, because Chalk just has a single `FnDefId` where
144-
/// we have different IDs for struct and enum variant constructors.
145-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
146-
pub struct CallableDefId(salsa::InternId);
147-
impl_intern_key!(CallableDefId);
148-
149143
impl TypeCtor {
150144
pub fn num_ty_params(self, db: &dyn HirDatabase) -> usize {
151145
match self {

crates/ra_hir_ty/src/traits/chalk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,14 @@ pub(crate) fn fn_def_datum_query(
552552
Arc::new(datum)
553553
}
554554

555-
impl From<FnDefId> for crate::CallableDefId {
555+
impl From<FnDefId> for crate::db::InternedCallableDefId {
556556
fn from(fn_def_id: FnDefId) -> Self {
557557
InternKey::from_intern_id(fn_def_id.0)
558558
}
559559
}
560560

561-
impl From<crate::CallableDefId> for FnDefId {
562-
fn from(callable_def_id: crate::CallableDefId) -> Self {
561+
impl From<crate::db::InternedCallableDefId> for FnDefId {
562+
fn from(callable_def_id: crate::db::InternedCallableDefId) -> Self {
563563
chalk_ir::FnDefId(callable_def_id.as_intern_id())
564564
}
565565
}

0 commit comments

Comments
 (0)