aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/traits')
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs
index fc21872b2..5eb032d86 100644
--- a/crates/ra_hir_ty/src/traits/chalk.rs
+++ b/crates/ra_hir_ty/src/traits/chalk.rs
@@ -9,7 +9,9 @@ use chalk_ir::{
9}; 9};
10use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; 10use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum};
11 11
12use hir_def::{AssocItemId, ContainerId, GenericDefId, ImplId, Lookup, TraitId, TypeAliasId}; 12use hir_def::{
13 AssocContainerId, AssocItemId, GenericDefId, HasModule, ImplId, Lookup, TraitId, TypeAliasId,
14};
13use ra_db::{ 15use ra_db::{
14 salsa::{InternId, InternKey}, 16 salsa::{InternId, InternKey},
15 CrateId, 17 CrateId,
@@ -542,7 +544,7 @@ pub(crate) fn associated_ty_data_query(
542 debug!("associated_ty_data {:?}", id); 544 debug!("associated_ty_data {:?}", id);
543 let type_alias: TypeAliasId = from_chalk(db, id); 545 let type_alias: TypeAliasId = from_chalk(db, id);
544 let trait_ = match type_alias.lookup(db).container { 546 let trait_ = match type_alias.lookup(db).container {
545 ContainerId::TraitId(t) => t, 547 AssocContainerId::TraitId(t) => t,
546 _ => panic!("associated type not in trait"), 548 _ => panic!("associated type not in trait"),
547 }; 549 };
548 let generic_params = generics(db, type_alias.into()); 550 let generic_params = generics(db, type_alias.into());
@@ -591,7 +593,7 @@ pub(crate) fn trait_datum_query(
591 let bound_vars = Substs::bound_vars(&generic_params); 593 let bound_vars = Substs::bound_vars(&generic_params);
592 let flags = chalk_rust_ir::TraitFlags { 594 let flags = chalk_rust_ir::TraitFlags {
593 auto: trait_data.auto, 595 auto: trait_data.auto,
594 upstream: trait_.lookup(db).container.krate != krate, 596 upstream: trait_.lookup(db).container.module(db).krate != krate,
595 non_enumerable: true, 597 non_enumerable: true,
596 coinductive: false, // only relevant for Chalk testing 598 coinductive: false, // only relevant for Chalk testing
597 // FIXME set these flags correctly 599 // FIXME set these flags correctly
@@ -671,7 +673,7 @@ fn impl_block_datum(
671 let bound_vars = Substs::bound_vars(&generic_params); 673 let bound_vars = Substs::bound_vars(&generic_params);
672 let trait_ref = trait_ref.subst(&bound_vars); 674 let trait_ref = trait_ref.subst(&bound_vars);
673 let trait_ = trait_ref.trait_; 675 let trait_ = trait_ref.trait_;
674 let impl_type = if impl_id.lookup(db).container.krate == krate { 676 let impl_type = if impl_id.lookup(db).container.module(db).krate == krate {
675 chalk_rust_ir::ImplType::Local 677 chalk_rust_ir::ImplType::Local
676 } else { 678 } else {
677 chalk_rust_ir::ImplType::External 679 chalk_rust_ir::ImplType::External
@@ -755,7 +757,7 @@ fn type_alias_associated_ty_value(
755) -> Arc<AssociatedTyValue<ChalkIr>> { 757) -> Arc<AssociatedTyValue<ChalkIr>> {
756 let type_alias_data = db.type_alias_data(type_alias); 758 let type_alias_data = db.type_alias_data(type_alias);
757 let impl_id = match type_alias.lookup(db).container { 759 let impl_id = match type_alias.lookup(db).container {
758 ContainerId::ImplId(it) => it, 760 AssocContainerId::ImplId(it) => it,
759 _ => panic!("assoc ty value should be in impl"), 761 _ => panic!("assoc ty value should be in impl"),
760 }; 762 };
761 763