diff options
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 898b823c0..c42ceabdf 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -10,6 +10,7 @@ use std::sync::Arc; | |||
10 | use hir_def::{ | 10 | use hir_def::{ |
11 | expr::{ExprId, PatId}, | 11 | expr::{ExprId, PatId}, |
12 | path::known, | 12 | path::known, |
13 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, | ||
13 | DefWithBodyId, | 14 | DefWithBodyId, |
14 | }; | 15 | }; |
15 | use hir_expand::{name::AsName, AstId, MacroCallId, MacroCallLoc, MacroFileKind, Source}; | 16 | use hir_expand::{name::AsName, AstId, MacroCallId, MacroCallLoc, MacroFileKind, Source}; |
@@ -24,11 +25,10 @@ use crate::{ | |||
24 | db::HirDatabase, | 25 | db::HirDatabase, |
25 | expr::{BodySourceMap, ExprScopes, ScopeId}, | 26 | expr::{BodySourceMap, ExprScopes, ScopeId}, |
26 | ids::LocationCtx, | 27 | ids::LocationCtx, |
27 | resolve::{self, resolver_for_scope, HasResolver, TypeNs, ValueNs}, | ||
28 | ty::method_resolution::{self, implements_trait}, | 28 | ty::method_resolution::{self, implements_trait}, |
29 | Adt, AssocItem, Const, DefWithBody, Either, Enum, EnumVariant, FromSource, Function, | 29 | Adt, AssocItem, Const, DefWithBody, Either, Enum, EnumVariant, FromSource, Function, |
30 | GenericParam, HasBody, HirFileId, Local, MacroDef, Module, Name, Path, Resolver, ScopeDef, | 30 | GenericParam, HasBody, HirFileId, Local, MacroDef, Module, Name, Path, ScopeDef, Static, |
31 | Static, Struct, Trait, Ty, TypeAlias, | 31 | Struct, Trait, Ty, TypeAlias, |
32 | }; | 32 | }; |
33 | 33 | ||
34 | fn try_get_resolver_for_node(db: &impl HirDatabase, node: Source<&SyntaxNode>) -> Option<Resolver> { | 34 | fn try_get_resolver_for_node(db: &impl HirDatabase, node: Source<&SyntaxNode>) -> Option<Resolver> { |
@@ -317,14 +317,14 @@ impl SourceAnalyzer { | |||
317 | pub fn process_all_names(&self, db: &impl HirDatabase, f: &mut dyn FnMut(Name, ScopeDef)) { | 317 | pub fn process_all_names(&self, db: &impl HirDatabase, f: &mut dyn FnMut(Name, ScopeDef)) { |
318 | self.resolver.process_all_names(db, &mut |name, def| { | 318 | self.resolver.process_all_names(db, &mut |name, def| { |
319 | let def = match def { | 319 | let def = match def { |
320 | resolve::ScopeDef::PerNs(it) => it.into(), | 320 | resolver::ScopeDef::PerNs(it) => it.into(), |
321 | resolve::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), | 321 | resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), |
322 | resolve::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), | 322 | resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), |
323 | resolve::ScopeDef::GenericParam(idx) => { | 323 | resolver::ScopeDef::GenericParam(idx) => { |
324 | let parent = self.resolver.generic_def().unwrap().into(); | 324 | let parent = self.resolver.generic_def().unwrap().into(); |
325 | ScopeDef::GenericParam(GenericParam { parent, idx }) | 325 | ScopeDef::GenericParam(GenericParam { parent, idx }) |
326 | } | 326 | } |
327 | resolve::ScopeDef::Local(pat_id) => { | 327 | resolver::ScopeDef::Local(pat_id) => { |
328 | let parent = self.resolver.body_owner().unwrap().into(); | 328 | let parent = self.resolver.body_owner().unwrap().into(); |
329 | ScopeDef::Local(Local { parent, pat_id }) | 329 | ScopeDef::Local(Local { parent, pat_id }) |
330 | } | 330 | } |