diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-20 15:45:22 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-20 15:45:22 +0000 |
commit | c51dcb1c4bdd71f9f17de508bd0d47e3c06ae1d5 (patch) | |
tree | 7e96d773620a3b03254d00386711cdc7c909e3ee /crates/ra_hir/src/source_binder.rs | |
parent | b7a36b54431ca5b746af53549a1b6e142570c7f4 (diff) | |
parent | 111891dc2dc1d2c7ea87144e8e3ddefe23fc7b6d (diff) |
Merge #2327
2327: Move constants to new ID r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index caa8d0082..fd9994098 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -71,7 +71,7 @@ fn def_with_body_from_child_node( | |||
71 | match_ast! { | 71 | match_ast! { |
72 | match node { | 72 | match node { |
73 | ast::FnDef(def) => { return Function::from_source(db, child.with_value(def)).map(DefWithBody::from); }, | 73 | ast::FnDef(def) => { return Function::from_source(db, child.with_value(def)).map(DefWithBody::from); }, |
74 | ast::ConstDef(def) => { Some(Const { id: ctx.to_def(&def) }.into()) }, | 74 | ast::ConstDef(def) => { return Const::from_source(db, child.with_value(def)).map(DefWithBody::from); }, |
75 | ast::StaticDef(def) => { Some(Static { id: ctx.to_def(&def) }.into()) }, | 75 | ast::StaticDef(def) => { Some(Static { id: ctx.to_def(&def) }.into()) }, |
76 | _ => { None }, | 76 | _ => { None }, |
77 | } | 77 | } |
@@ -428,6 +428,11 @@ impl SourceAnalyzer { | |||
428 | pub(crate) fn inference_result(&self) -> Arc<crate::ty::InferenceResult> { | 428 | pub(crate) fn inference_result(&self) -> Arc<crate::ty::InferenceResult> { |
429 | self.infer.clone().unwrap() | 429 | self.infer.clone().unwrap() |
430 | } | 430 | } |
431 | |||
432 | #[cfg(test)] | ||
433 | pub(crate) fn analyzed_declaration(&self) -> Option<DefWithBody> { | ||
434 | self.body_owner | ||
435 | } | ||
431 | } | 436 | } |
432 | 437 | ||
433 | fn scope_for( | 438 | fn scope_for( |