Skip to content

Commit 36052ce

Browse files
committed
Lookup adt names
1 parent 10c3327 commit 36052ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/hir_ty/src/traits/chalk.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
246246
}
247247
// FIXME: lookup names
248248
fn adt_name(&self, struct_id: chalk_ir::AdtId<Interner>) -> String {
249-
format!("Adt_{:?}", struct_id.0).replace("TypeCtorId(", "").replace(")", "")
249+
let datum = self.db.struct_datum(self.krate, struct_id);
250+
format!("{:?}", datum.name(&Interner))
250251
}
251252
fn assoc_type_name(&self, assoc_ty_id: chalk_ir::AssocTypeId<Interner>) -> String {
252253
format!("Assoc_{}", assoc_ty_id.0)

0 commit comments

Comments
 (0)