diff options
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 0df7a7cb4..28d41b647 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -7,6 +7,7 @@ | |||
7 | //! purely for "IDE needs". | 7 | //! purely for "IDE needs". |
8 | use std::sync::Arc; | 8 | use std::sync::Arc; |
9 | 9 | ||
10 | use either::Either; | ||
10 | use hir_def::{ | 11 | use hir_def::{ |
11 | body::{ | 12 | body::{ |
12 | scope::{ExprScopes, ScopeId}, | 13 | scope::{ExprScopes, ScopeId}, |
@@ -33,8 +34,8 @@ use crate::{ | |||
33 | method_resolution::{self, implements_trait}, | 34 | method_resolution::{self, implements_trait}, |
34 | InEnvironment, TraitEnvironment, Ty, | 35 | InEnvironment, TraitEnvironment, Ty, |
35 | }, | 36 | }, |
36 | Adt, AssocItem, Const, DefWithBody, Either, Enum, EnumVariant, FromSource, Function, | 37 | Adt, AssocItem, Const, DefWithBody, Enum, EnumVariant, FromSource, Function, GenericParam, |
37 | GenericParam, Local, MacroDef, Name, Path, ScopeDef, Static, Struct, Trait, Type, TypeAlias, | 38 | Local, MacroDef, Name, Path, ScopeDef, Static, Struct, Trait, Type, TypeAlias, |
38 | }; | 39 | }; |
39 | 40 | ||
40 | fn try_get_resolver_for_node(db: &impl HirDatabase, node: InFile<&SyntaxNode>) -> Option<Resolver> { | 41 | fn try_get_resolver_for_node(db: &impl HirDatabase, node: InFile<&SyntaxNode>) -> Option<Resolver> { |
@@ -349,7 +350,7 @@ impl SourceAnalyzer { | |||
349 | // should switch to general reference search infra there. | 350 | // should switch to general reference search infra there. |
350 | pub fn find_all_refs(&self, pat: &ast::BindPat) -> Vec<ReferenceDescriptor> { | 351 | pub fn find_all_refs(&self, pat: &ast::BindPat) -> Vec<ReferenceDescriptor> { |
351 | let fn_def = pat.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); | 352 | let fn_def = pat.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); |
352 | let ptr = Either::A(AstPtr::new(&ast::Pat::from(pat.clone()))); | 353 | let ptr = Either::Left(AstPtr::new(&ast::Pat::from(pat.clone()))); |
353 | fn_def | 354 | fn_def |
354 | .syntax() | 355 | .syntax() |
355 | .descendants() | 356 | .descendants() |