diff options
Diffstat (limited to 'crates/hir_ty/src/chalk_db.rs')
-rw-r--r-- | crates/hir_ty/src/chalk_db.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/hir_ty/src/chalk_db.rs b/crates/hir_ty/src/chalk_db.rs index 9d07ad597..8f054d06b 100644 --- a/crates/hir_ty/src/chalk_db.rs +++ b/crates/hir_ty/src/chalk_db.rs | |||
@@ -17,7 +17,7 @@ use hir_expand::name::name; | |||
17 | use crate::{ | 17 | use crate::{ |
18 | db::HirDatabase, | 18 | db::HirDatabase, |
19 | display::HirDisplay, | 19 | display::HirDisplay, |
20 | from_assoc_type_id, make_only_type_binders, | 20 | from_assoc_type_id, from_chalk_trait_id, make_only_type_binders, |
21 | mapping::{from_chalk, ToChalk, TypeAliasAsValue}, | 21 | mapping::{from_chalk, ToChalk, TypeAliasAsValue}, |
22 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, | 22 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, |
23 | to_assoc_type_id, to_chalk_trait_id, | 23 | to_assoc_type_id, to_chalk_trait_id, |
@@ -79,7 +79,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
79 | binders: &CanonicalVarKinds<Interner>, | 79 | binders: &CanonicalVarKinds<Interner>, |
80 | ) -> Vec<ImplId> { | 80 | ) -> Vec<ImplId> { |
81 | debug!("impls_for_trait {:?}", trait_id); | 81 | debug!("impls_for_trait {:?}", trait_id); |
82 | let trait_: hir_def::TraitId = from_chalk(self.db, trait_id); | 82 | let trait_: hir_def::TraitId = from_chalk_trait_id(trait_id); |
83 | 83 | ||
84 | let ty: Ty = parameters[0].assert_ty_ref(&Interner).clone(); | 84 | let ty: Ty = parameters[0].assert_ty_ref(&Interner).clone(); |
85 | 85 | ||
@@ -161,7 +161,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
161 | Some(LangItemTarget::TraitId(trait_)) => trait_, | 161 | Some(LangItemTarget::TraitId(trait_)) => trait_, |
162 | _ => return None, | 162 | _ => return None, |
163 | }; | 163 | }; |
164 | Some(trait_.to_chalk(self.db)) | 164 | Some(to_chalk_trait_id(trait_)) |
165 | } | 165 | } |
166 | 166 | ||
167 | fn program_clauses_for_env( | 167 | fn program_clauses_for_env( |
@@ -308,7 +308,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
308 | } | 308 | } |
309 | 309 | ||
310 | fn trait_name(&self, trait_id: chalk_ir::TraitId<Interner>) -> String { | 310 | fn trait_name(&self, trait_id: chalk_ir::TraitId<Interner>) -> String { |
311 | let id = from_chalk(self.db, trait_id); | 311 | let id = from_chalk_trait_id(trait_id); |
312 | self.db.trait_data(id).name.to_string() | 312 | self.db.trait_data(id).name.to_string() |
313 | } | 313 | } |
314 | fn adt_name(&self, chalk_ir::AdtId(adt_id): AdtId) -> String { | 314 | fn adt_name(&self, chalk_ir::AdtId(adt_id): AdtId) -> String { |
@@ -413,7 +413,7 @@ pub(crate) fn trait_datum_query( | |||
413 | trait_id: TraitId, | 413 | trait_id: TraitId, |
414 | ) -> Arc<TraitDatum> { | 414 | ) -> Arc<TraitDatum> { |
415 | debug!("trait_datum {:?}", trait_id); | 415 | debug!("trait_datum {:?}", trait_id); |
416 | let trait_: hir_def::TraitId = from_chalk(db, trait_id); | 416 | let trait_ = from_chalk_trait_id(trait_id); |
417 | let trait_data = db.trait_data(trait_); | 417 | let trait_data = db.trait_data(trait_); |
418 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); | 418 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); |
419 | let generic_params = generics(db.upcast(), trait_.into()); | 419 | let generic_params = generics(db.upcast(), trait_.into()); |
@@ -723,7 +723,10 @@ pub(super) fn generic_predicate_to_inline_bound( | |||
723 | .collect(); | 723 | .collect(); |
724 | let alias_eq_bound = rust_ir::AliasEqBound { | 724 | let alias_eq_bound = rust_ir::AliasEqBound { |
725 | value: ty.clone(), | 725 | value: ty.clone(), |
726 | trait_bound: rust_ir::TraitBound { trait_id: trait_.to_chalk(db), args_no_self }, | 726 | trait_bound: rust_ir::TraitBound { |
727 | trait_id: to_chalk_trait_id(trait_), | ||
728 | args_no_self, | ||
729 | }, | ||
727 | associated_ty_id: projection_ty.associated_ty_id, | 730 | associated_ty_id: projection_ty.associated_ty_id, |
728 | parameters: Vec::new(), // FIXME we don't support generic associated types yet | 731 | parameters: Vec::new(), // FIXME we don't support generic associated types yet |
729 | }; | 732 | }; |