aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits/chalk.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-20 11:43:19 +0000
committerGitHub <[email protected]>2019-12-20 11:43:19 +0000
commit65377620245bda207145742595a7bd878e14f7ec (patch)
treed2016e6e3ce596e6a4b3e44f4894b5a411c62789 /crates/ra_hir_ty/src/traits/chalk.rs
parent6e9335d311c058986c4bbef5aadbe208b87f63c7 (diff)
parentf42697e54b9d0a040011cb04c266d51710e249f1 (diff)
Merge #2608
2608: Support for nested traits r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/traits/chalk.rs')
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs
index fc21872b2..dd4fa9664 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
@@ -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