diff options
author | Florian Diebold <[email protected]> | 2019-10-31 20:21:48 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-11-01 18:57:08 +0000 |
commit | 79cb0a0dab5fd8e3e84cf4a3b927ec29d2b6e65c (patch) | |
tree | 88f2ebdf338d230f6019d56acb96bea0878f7248 /crates/ra_hir/src/source_binder.rs | |
parent | 5da941897d4ed092a219729d7980bd103907850a (diff) |
Complete trait assoc items
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 0398806fd..82e6eb852 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -27,7 +27,7 @@ use crate::{ | |||
27 | }, | 27 | }, |
28 | ids::LocationCtx, | 28 | ids::LocationCtx, |
29 | resolve::{ScopeDef, TypeNs, ValueNs}, | 29 | resolve::{ScopeDef, TypeNs, ValueNs}, |
30 | ty::method_resolution::implements_trait, | 30 | ty::method_resolution::{self, implements_trait}, |
31 | AssocItem, Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, | 31 | AssocItem, Const, DefWithBody, Either, Enum, FromSource, Function, HasBody, HirFileId, |
32 | MacroDef, Module, Name, Path, Resolver, Static, Struct, Ty, | 32 | MacroDef, Module, Name, Path, Resolver, Static, Struct, Ty, |
33 | }; | 33 | }; |
@@ -327,17 +327,19 @@ impl SourceAnalyzer { | |||
327 | db: &impl HirDatabase, | 327 | db: &impl HirDatabase, |
328 | ty: Ty, | 328 | ty: Ty, |
329 | name: Option<&Name>, | 329 | name: Option<&Name>, |
330 | mode: method_resolution::LookupMode, | ||
330 | callback: impl FnMut(&Ty, AssocItem) -> Option<T>, | 331 | callback: impl FnMut(&Ty, AssocItem) -> Option<T>, |
331 | ) -> Option<T> { | 332 | ) -> Option<T> { |
332 | // There should be no inference vars in types passed here | 333 | // There should be no inference vars in types passed here |
333 | // FIXME check that? | 334 | // FIXME check that? |
335 | // FIXME replace Unknown by bound vars here | ||
334 | let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; | 336 | let canonical = crate::ty::Canonical { value: ty, num_vars: 0 }; |
335 | crate::ty::method_resolution::iterate_method_candidates( | 337 | method_resolution::iterate_method_candidates( |
336 | &canonical, | 338 | &canonical, |
337 | db, | 339 | db, |
338 | &self.resolver, | 340 | &self.resolver, |
339 | name, | 341 | name, |
340 | crate::ty::method_resolution::LookupMode::MethodCall, | 342 | mode, |
341 | callback, | 343 | callback, |
342 | ) | 344 | ) |
343 | } | 345 | } |