diff options
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index a5d99beda..d9ee9d37f 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -11,7 +11,7 @@ use ra_syntax::{ | |||
11 | use ra_db::{SourceRootId, Cancelable,}; | 11 | use ra_db::{SourceRootId, Cancelable,}; |
12 | 12 | ||
13 | use crate::{ | 13 | use crate::{ |
14 | SourceFileItems, SourceItemId, DefKind, Function, DefId, Name, AsName, HirFileId, | 14 | SourceFileItems, SourceItemId, DefKind, DefId, Name, AsName, HirFileId, |
15 | MacroCallLoc, | 15 | MacroCallLoc, |
16 | db::HirDatabase, | 16 | db::HirDatabase, |
17 | function::FnScopes, | 17 | function::FnScopes, |
@@ -23,11 +23,10 @@ use crate::{ | |||
23 | adt::{StructData, EnumData}, | 23 | adt::{StructData, EnumData}, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | pub(super) fn fn_scopes(db: &impl HirDatabase, def_id: DefId) -> Arc<FnScopes> { | 26 | pub(super) fn fn_scopes(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<FnScopes>> { |
27 | let function = Function::new(def_id); | 27 | let body = db.body_hir(def_id)?; |
28 | let syntax = function.syntax(db); | 28 | let res = FnScopes::new(body); |
29 | let res = FnScopes::new(syntax.borrowed()); | 29 | Ok(Arc::new(res)) |
30 | Arc::new(res) | ||
31 | } | 30 | } |
32 | 31 | ||
33 | pub(super) fn struct_data(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<StructData>> { | 32 | pub(super) fn struct_data(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<StructData>> { |