From 27fe68ad5c908d439af6cfbe7748c56eb6f107fc Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 22 May 2020 17:50:58 +0200 Subject: Use TypeCtorId as AdtId directly, and rename the type alias StructId -> AdtId --- crates/ra_hir_ty/src/traits/chalk/interner.rs | 6 +++--- crates/ra_hir_ty/src/traits/chalk/tls.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_ty/src/traits/chalk') diff --git a/crates/ra_hir_ty/src/traits/chalk/interner.rs b/crates/ra_hir_ty/src/traits/chalk/interner.rs index 032deca75..d98e5cb2d 100644 --- a/crates/ra_hir_ty/src/traits/chalk/interner.rs +++ b/crates/ra_hir_ty/src/traits/chalk/interner.rs @@ -14,7 +14,7 @@ pub type AssocTypeId = chalk_ir::AssocTypeId; pub type AssociatedTyDatum = chalk_rust_ir::AssociatedTyDatum; pub type TraitId = chalk_ir::TraitId; pub type TraitDatum = chalk_rust_ir::TraitDatum; -pub type StructId = chalk_ir::AdtId; +pub type AdtId = chalk_ir::AdtId; pub type StructDatum = chalk_rust_ir::AdtDatum; pub type ImplId = chalk_ir::ImplId; pub type ImplDatum = chalk_rust_ir::ImplDatum; @@ -36,10 +36,10 @@ impl chalk_ir::interner::Interner for Interner { type InternedVariableKinds = Vec>; type InternedCanonicalVarKinds = Vec>; type DefId = InternId; - type InternedAdtId = InternId; + type InternedAdtId = crate::TypeCtorId; type Identifier = TypeAliasId; - fn debug_adt_id(type_kind_id: StructId, fmt: &mut fmt::Formatter<'_>) -> Option { + fn debug_adt_id(type_kind_id: AdtId, fmt: &mut fmt::Formatter<'_>) -> Option { tls::with_current_program(|prog| Some(prog?.debug_struct_id(type_kind_id, fmt))) } diff --git a/crates/ra_hir_ty/src/traits/chalk/tls.rs b/crates/ra_hir_ty/src/traits/chalk/tls.rs index b7eb49d7b..5dfd8e3ec 100644 --- a/crates/ra_hir_ty/src/traits/chalk/tls.rs +++ b/crates/ra_hir_ty/src/traits/chalk/tls.rs @@ -15,7 +15,7 @@ pub struct DebugContext<'a>(&'a (dyn HirDatabase + 'a)); impl DebugContext<'_> { pub fn debug_struct_id( &self, - id: super::StructId, + id: super::AdtId, f: &mut fmt::Formatter<'_>, ) -> Result<(), fmt::Error> { let type_ctor: TypeCtor = from_chalk(self.0, TypeName::Adt(id)); -- cgit v1.2.3