diff options
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 05f5bca57..76c493f1a 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -8,6 +8,10 @@ | |||
8 | use std::sync::Arc; | 8 | use std::sync::Arc; |
9 | 9 | ||
10 | use hir_def::{ | 10 | use hir_def::{ |
11 | body::{ | ||
12 | scope::{ExprScopes, ScopeId}, | ||
13 | BodySourceMap, | ||
14 | }, | ||
11 | expr::{ExprId, PatId}, | 15 | expr::{ExprId, PatId}, |
12 | path::known, | 16 | path::known, |
13 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, | 17 | resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs}, |
@@ -25,7 +29,6 @@ use ra_syntax::{ | |||
25 | 29 | ||
26 | use crate::{ | 30 | use crate::{ |
27 | db::HirDatabase, | 31 | db::HirDatabase, |
28 | expr::{BodySourceMap, ExprScopes, ScopeId}, | ||
29 | ty::{ | 32 | ty::{ |
30 | method_resolution::{self, implements_trait}, | 33 | method_resolution::{self, implements_trait}, |
31 | InEnvironment, TraitEnvironment, Ty, | 34 | InEnvironment, TraitEnvironment, Ty, |
@@ -91,7 +94,7 @@ pub struct SourceAnalyzer { | |||
91 | body_owner: Option<DefWithBody>, | 94 | body_owner: Option<DefWithBody>, |
92 | body_source_map: Option<Arc<BodySourceMap>>, | 95 | body_source_map: Option<Arc<BodySourceMap>>, |
93 | infer: Option<Arc<crate::ty::InferenceResult>>, | 96 | infer: Option<Arc<crate::ty::InferenceResult>>, |
94 | scopes: Option<Arc<crate::expr::ExprScopes>>, | 97 | scopes: Option<Arc<ExprScopes>>, |
95 | } | 98 | } |
96 | 99 | ||
97 | #[derive(Debug, Clone, PartialEq, Eq)] | 100 | #[derive(Debug, Clone, PartialEq, Eq)] |
@@ -455,21 +458,6 @@ impl SourceAnalyzer { | |||
455 | macro_file_kind: to_macro_file_kind(macro_call.value), | 458 | macro_file_kind: to_macro_file_kind(macro_call.value), |
456 | }) | 459 | }) |
457 | } | 460 | } |
458 | |||
459 | #[cfg(test)] | ||
460 | pub(crate) fn body_source_map(&self) -> Arc<BodySourceMap> { | ||
461 | self.body_source_map.clone().unwrap() | ||
462 | } | ||
463 | |||
464 | #[cfg(test)] | ||
465 | pub(crate) fn inference_result(&self) -> Arc<crate::ty::InferenceResult> { | ||
466 | self.infer.clone().unwrap() | ||
467 | } | ||
468 | |||
469 | #[cfg(test)] | ||
470 | pub(crate) fn analyzed_declaration(&self) -> Option<DefWithBody> { | ||
471 | self.body_owner | ||
472 | } | ||
473 | } | 461 | } |
474 | 462 | ||
475 | fn scope_for( | 463 | fn scope_for( |