aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-27 14:46:02 +0000
committerAleksey Kladov <[email protected]>2019-11-27 18:16:00 +0000
commita87579500a2c35597071efd0ad6983927f0c1815 (patch)
tree9805b3dcbf8d767b2fc0623f42794068f3660d44 /crates/ra_hir/src/source_binder.rs
parent368653081558ab389c6543d6b5027859e26beb3b (diff)
Move Ty
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs22
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 @@
8use std::sync::Arc; 8use std::sync::Arc;
9 9
10use hir_def::{ 10use 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
26use crate::{ 30use 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
475fn scope_for( 463fn scope_for(