diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 13:00:41 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-16 13:00:41 +0100 |
commit | b81caed43f1886024ededad41a1baa8a03f1d2f4 (patch) | |
tree | 0a0289899ec59b425eae6369929a01e97065ce43 /crates/ra_hir/src/db.rs | |
parent | e6fbff3246cdd3278ff1c376d5abfc1d579f86c2 (diff) | |
parent | ad3673d8d86a9b8f1a8dba858abd7cabaa1d5776 (diff) |
Merge #1408
1408: Associated type basics & Deref support r=matklad a=flodiebold
This adds the necessary Chalk integration to handle associated types and uses it to implement support for `Deref` in the `*` operator and autoderef; so e.g. dot completions through an `Arc` work now.
It doesn't yet implement resolution of associated types in paths, though. Also, there's a big FIXME about handling variables in the solution we get from Chalk correctly.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/db.rs')
-rw-r--r-- | crates/ra_hir/src/db.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index d2d6f95b7..c4dd54596 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs | |||
@@ -16,9 +16,8 @@ use crate::{ | |||
16 | adt::{StructData, EnumData}, | 16 | adt::{StructData, EnumData}, |
17 | impl_block::{ModuleImplBlocks, ImplSourceMap, ImplBlock}, | 17 | impl_block::{ModuleImplBlocks, ImplSourceMap, ImplBlock}, |
18 | generics::{GenericParams, GenericDef}, | 18 | generics::{GenericParams, GenericDef}, |
19 | type_ref::TypeRef, | ||
20 | traits::TraitData, | 19 | traits::TraitData, |
21 | lang_item::{LangItems, LangItemTarget}, | 20 | lang_item::{LangItems, LangItemTarget}, type_alias::TypeAliasData, |
22 | }; | 21 | }; |
23 | 22 | ||
24 | // This database has access to source code, so queries here are not really | 23 | // This database has access to source code, so queries here are not really |
@@ -113,8 +112,8 @@ pub trait DefDatabase: SourceDatabase { | |||
113 | #[salsa::invoke(crate::FnSignature::fn_signature_query)] | 112 | #[salsa::invoke(crate::FnSignature::fn_signature_query)] |
114 | fn fn_signature(&self, func: Function) -> Arc<FnSignature>; | 113 | fn fn_signature(&self, func: Function) -> Arc<FnSignature>; |
115 | 114 | ||
116 | #[salsa::invoke(crate::type_alias::type_alias_ref_query)] | 115 | #[salsa::invoke(crate::type_alias::type_alias_data_query)] |
117 | fn type_alias_ref(&self, typ: TypeAlias) -> Arc<TypeRef>; | 116 | fn type_alias_data(&self, typ: TypeAlias) -> Arc<TypeAliasData>; |
118 | 117 | ||
119 | #[salsa::invoke(crate::ConstSignature::const_signature_query)] | 118 | #[salsa::invoke(crate::ConstSignature::const_signature_query)] |
120 | fn const_signature(&self, konst: Const) -> Arc<ConstSignature>; | 119 | fn const_signature(&self, konst: Const) -> Arc<ConstSignature>; |
@@ -185,6 +184,13 @@ pub trait HirDatabase: DefDatabase + AstDatabase { | |||
185 | krate: Crate, | 184 | krate: Crate, |
186 | goal: crate::ty::Canonical<crate::ty::TraitRef>, | 185 | goal: crate::ty::Canonical<crate::ty::TraitRef>, |
187 | ) -> Option<crate::ty::traits::Solution>; | 186 | ) -> Option<crate::ty::traits::Solution>; |
187 | |||
188 | #[salsa::invoke(crate::ty::traits::normalize_query)] | ||
189 | fn normalize( | ||
190 | &self, | ||
191 | krate: Crate, | ||
192 | goal: crate::ty::Canonical<crate::ty::ProjectionPredicate>, | ||
193 | ) -> Option<crate::ty::traits::Solution>; | ||
188 | } | 194 | } |
189 | 195 | ||
190 | #[test] | 196 | #[test] |