diff options
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index b33653417..08c2c9a3e 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -240,20 +240,22 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
240 | Substs::empty().to_chalk(self.db) | 240 | Substs::empty().to_chalk(self.db) |
241 | } | 241 | } |
242 | 242 | ||
243 | fn trait_name(&self, _trait_id: chalk_ir::TraitId<Interner>) -> String { | 243 | fn trait_name(&self, trait_id: chalk_ir::TraitId<Interner>) -> String { |
244 | unimplemented!() | 244 | let id = from_chalk(self.db, trait_id); |
245 | self.db.trait_data(id).name.to_string() | ||
245 | } | 246 | } |
246 | fn adt_name(&self, _struct_id: chalk_ir::AdtId<Interner>) -> String { | 247 | // FIXME: lookup names |
247 | unimplemented!() | 248 | fn adt_name(&self, struct_id: chalk_ir::AdtId<Interner>) -> String { |
249 | format!("Adt_{:?}", struct_id.0).replace("TypeCtorId(", "").replace(")", "") | ||
248 | } | 250 | } |
249 | fn assoc_type_name(&self, _assoc_ty_id: chalk_ir::AssocTypeId<Interner>) -> String { | 251 | fn assoc_type_name(&self, assoc_ty_id: chalk_ir::AssocTypeId<Interner>) -> String { |
250 | unimplemented!() | 252 | format!("Assoc_{}", assoc_ty_id.0) |
251 | } | 253 | } |
252 | fn opaque_type_name(&self, _opaque_ty_id: chalk_ir::OpaqueTyId<Interner>) -> String { | 254 | fn opaque_type_name(&self, opaque_ty_id: chalk_ir::OpaqueTyId<Interner>) -> String { |
253 | unimplemented!() | 255 | format!("Opaque_{}", opaque_ty_id.0) |
254 | } | 256 | } |
255 | fn fn_def_name(&self, _fn_def_id: chalk_ir::FnDefId<Interner>) -> String { | 257 | fn fn_def_name(&self, fn_def_id: chalk_ir::FnDefId<Interner>) -> String { |
256 | unimplemented!() | 258 | format!("fn_{}", fn_def_id.0) |
257 | } | 259 | } |
258 | } | 260 | } |
259 | 261 | ||