aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r--crates/ra_hir_ty/src/lower.rs9
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs6
2 files changed, 7 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs
index eab91229e..5f795bc02 100644
--- a/crates/ra_hir_ty/src/lower.rs
+++ b/crates/ra_hir_ty/src/lower.rs
@@ -14,7 +14,7 @@ use hir_def::{
14 path::{GenericArg, Path, PathKind, PathSegment}, 14 path::{GenericArg, Path, PathKind, PathSegment},
15 resolver::{HasResolver, Resolver, TypeNs}, 15 resolver::{HasResolver, Resolver, TypeNs},
16 type_ref::{TypeBound, TypeRef}, 16 type_ref::{TypeBound, TypeRef},
17 AdtId, AstItemDef, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId, 17 AdtId, ConstId, EnumId, EnumVariantId, FunctionId, GenericDefId, HasModule, ImplId,
18 LocalStructFieldId, Lookup, StaticId, StructId, TraitId, TypeAliasId, UnionId, VariantId, 18 LocalStructFieldId, Lookup, StaticId, StructId, TraitId, TypeAliasId, UnionId, VariantId,
19}; 19};
20use ra_arena::map::ArenaMap; 20use ra_arena::map::ArenaMap;
@@ -698,10 +698,11 @@ impl_froms!(CallableDef: FunctionId, StructId, EnumVariantId);
698impl CallableDef { 698impl CallableDef {
699 pub fn krate(self, db: &impl HirDatabase) -> CrateId { 699 pub fn krate(self, db: &impl HirDatabase) -> CrateId {
700 match self { 700 match self {
701 CallableDef::FunctionId(f) => f.lookup(db).module(db).krate, 701 CallableDef::FunctionId(f) => f.lookup(db).module(db),
702 CallableDef::StructId(s) => s.module(db).krate, 702 CallableDef::StructId(s) => s.lookup(db).container,
703 CallableDef::EnumVariantId(e) => e.parent.module(db).krate, 703 CallableDef::EnumVariantId(e) => e.parent.lookup(db).container,
704 } 704 }
705 .krate
705 } 706 }
706} 707}
707 708
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs
index ff299f511..fc21872b2 100644
--- a/crates/ra_hir_ty/src/traits/chalk.rs
+++ b/crates/ra_hir_ty/src/traits/chalk.rs
@@ -9,9 +9,7 @@ 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::{ 12use hir_def::{AssocItemId, ContainerId, GenericDefId, ImplId, Lookup, TraitId, TypeAliasId};
13 AssocItemId, AstItemDef, ContainerId, GenericDefId, ImplId, Lookup, TraitId, TypeAliasId,
14};
15use ra_db::{ 13use ra_db::{
16 salsa::{InternId, InternKey}, 14 salsa::{InternId, InternKey},
17 CrateId, 15 CrateId,
@@ -593,7 +591,7 @@ pub(crate) fn trait_datum_query(
593 let bound_vars = Substs::bound_vars(&generic_params); 591 let bound_vars = Substs::bound_vars(&generic_params);
594 let flags = chalk_rust_ir::TraitFlags { 592 let flags = chalk_rust_ir::TraitFlags {
595 auto: trait_data.auto, 593 auto: trait_data.auto,
596 upstream: trait_.module(db).krate != krate, 594 upstream: trait_.lookup(db).container.krate != krate,
597 non_enumerable: true, 595 non_enumerable: true,
598 coinductive: false, // only relevant for Chalk testing 596 coinductive: false, // only relevant for Chalk testing
599 // FIXME set these flags correctly 597 // FIXME set these flags correctly