diff options
author | Florian Diebold <[email protected]> | 2020-05-22 16:50:58 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-05-22 18:52:06 +0100 |
commit | 27fe68ad5c908d439af6cfbe7748c56eb6f107fc (patch) | |
tree | 4931a1d08d930dadee18e2f9d521e29d255f81b2 /crates/ra_hir_ty/src/traits/chalk.rs | |
parent | 1d0e27254d6376e980dc19e67dfcc598c7e97231 (diff) |
Use TypeCtorId as AdtId directly, and rename the type alias StructId -> AdtId
Diffstat (limited to 'crates/ra_hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 6c286ead7..e2f2a9ccb 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -45,7 +45,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
45 | fn trait_datum(&self, trait_id: TraitId) -> Arc<TraitDatum> { | 45 | fn trait_datum(&self, trait_id: TraitId) -> Arc<TraitDatum> { |
46 | self.db.trait_datum(self.krate, trait_id) | 46 | self.db.trait_datum(self.krate, trait_id) |
47 | } | 47 | } |
48 | fn adt_datum(&self, struct_id: StructId) -> Arc<StructDatum> { | 48 | fn adt_datum(&self, struct_id: AdtId) -> Arc<StructDatum> { |
49 | self.db.struct_datum(self.krate, struct_id) | 49 | self.db.struct_datum(self.krate, struct_id) |
50 | } | 50 | } |
51 | fn impl_datum(&self, impl_id: ImplId) -> Arc<ImplDatum> { | 51 | fn impl_datum(&self, impl_id: ImplId) -> Arc<ImplDatum> { |
@@ -94,7 +94,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
94 | debug!("impls_for_trait returned {} impls", result.len()); | 94 | debug!("impls_for_trait returned {} impls", result.len()); |
95 | result | 95 | result |
96 | } | 96 | } |
97 | fn impl_provided_for(&self, auto_trait_id: TraitId, struct_id: StructId) -> bool { | 97 | fn impl_provided_for(&self, auto_trait_id: TraitId, struct_id: AdtId) -> bool { |
98 | debug!("impl_provided_for {:?}, {:?}", auto_trait_id, struct_id); | 98 | debug!("impl_provided_for {:?}, {:?}", auto_trait_id, struct_id); |
99 | false // FIXME | 99 | false // FIXME |
100 | } | 100 | } |
@@ -257,7 +257,7 @@ fn lang_attr_from_well_known_trait(attr: WellKnownTrait) -> &'static str { | |||
257 | pub(crate) fn struct_datum_query( | 257 | pub(crate) fn struct_datum_query( |
258 | db: &dyn HirDatabase, | 258 | db: &dyn HirDatabase, |
259 | krate: CrateId, | 259 | krate: CrateId, |
260 | struct_id: StructId, | 260 | struct_id: AdtId, |
261 | ) -> Arc<StructDatum> { | 261 | ) -> Arc<StructDatum> { |
262 | debug!("struct_datum {:?}", struct_id); | 262 | debug!("struct_datum {:?}", struct_id); |
263 | let type_ctor: TypeCtor = from_chalk(db, TypeName::Adt(struct_id)); | 263 | let type_ctor: TypeCtor = from_chalk(db, TypeName::Adt(struct_id)); |
@@ -405,15 +405,15 @@ fn type_alias_associated_ty_value( | |||
405 | Arc::new(value) | 405 | Arc::new(value) |
406 | } | 406 | } |
407 | 407 | ||
408 | impl From<StructId> for crate::TypeCtorId { | 408 | impl From<AdtId> for crate::TypeCtorId { |
409 | fn from(struct_id: StructId) -> Self { | 409 | fn from(struct_id: AdtId) -> Self { |
410 | InternKey::from_intern_id(struct_id.0) | 410 | struct_id.0 |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | impl From<crate::TypeCtorId> for StructId { | 414 | impl From<crate::TypeCtorId> for AdtId { |
415 | fn from(type_ctor_id: crate::TypeCtorId) -> Self { | 415 | fn from(type_ctor_id: crate::TypeCtorId) -> Self { |
416 | chalk_ir::AdtId(type_ctor_id.as_intern_id()) | 416 | chalk_ir::AdtId(type_ctor_id) |
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||