diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-06 19:08:00 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-06 19:08:00 +0000 |
commit | 3928255b6f919ca0a0a93393ab7fa3d0ce6df681 (patch) | |
tree | fd67f18d5a631a1cbcb84cbe3455713943253fb8 /crates/ra_analysis/src/descriptors/function/imp.rs | |
parent | 21797bf0efdeafde4148fe02ba4bd11171737872 (diff) | |
parent | 7f88fe8790014f4c879ec49de4bfdb823043e16a (diff) |
Merge #209
209: Owned nodes r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/descriptors/function/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/descriptors/function/imp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/descriptors/function/imp.rs b/crates/ra_analysis/src/descriptors/function/imp.rs index 755e05819..a989a04cd 100644 --- a/crates/ra_analysis/src/descriptors/function/imp.rs +++ b/crates/ra_analysis/src/descriptors/function/imp.rs | |||
@@ -11,11 +11,11 @@ use crate::descriptors::{ | |||
11 | /// TODO: this should return something more type-safe then `SyntaxNode` | 11 | /// TODO: this should return something more type-safe then `SyntaxNode` |
12 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { | 12 | pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode { |
13 | let syntax = db.resolve_syntax_ptr(fn_id.0); | 13 | let syntax = db.resolve_syntax_ptr(fn_id.0); |
14 | FnDef::cast(syntax.borrowed()).unwrap().into() | 14 | FnDef::cast(syntax.borrowed()).unwrap().owned() |
15 | } | 15 | } |
16 | 16 | ||
17 | pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { | 17 | pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { |
18 | let syntax = db.fn_syntax(fn_id); | 18 | let syntax = db.fn_syntax(fn_id); |
19 | let res = FnScopes::new(syntax.ast()); | 19 | let res = FnScopes::new(syntax.borrowed()); |
20 | Arc::new(res) | 20 | Arc::new(res) |
21 | } | 21 | } |