diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 4fb5844f4..779764590 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -4,10 +4,7 @@ pub(crate) mod docs; | |||
4 | use std::sync::Arc; | 4 | use std::sync::Arc; |
5 | 5 | ||
6 | use ra_db::{CrateId, Edition, FileId, SourceRootId}; | 6 | use ra_db::{CrateId, Edition, FileId, SourceRootId}; |
7 | use ra_syntax::{ | 7 | use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; |
8 | ast::{self, NameOwner, TypeAscriptionOwner}, | ||
9 | TreeArc, | ||
10 | }; | ||
11 | 8 | ||
12 | use crate::{ | 9 | use crate::{ |
13 | adt::{EnumVariantId, StructFieldId, VariantDef}, | 10 | adt::{EnumVariantId, StructFieldId, VariantDef}, |
@@ -155,8 +152,8 @@ impl_froms!( | |||
155 | ); | 152 | ); |
156 | 153 | ||
157 | pub enum ModuleSource { | 154 | pub enum ModuleSource { |
158 | SourceFile(TreeArc<ast::SourceFile>), | 155 | SourceFile(ast::SourceFile), |
159 | Module(TreeArc<ast::Module>), | 156 | Module(ast::Module), |
160 | } | 157 | } |
161 | 158 | ||
162 | impl ModuleSource { | 159 | impl ModuleSource { |
@@ -199,7 +196,7 @@ impl Module { | |||
199 | self, | 196 | self, |
200 | db: &impl HirDatabase, | 197 | db: &impl HirDatabase, |
201 | import: ImportId, | 198 | import: ImportId, |
202 | ) -> Either<TreeArc<ast::UseTree>, TreeArc<ast::ExternCrateItem>> { | 199 | ) -> Either<ast::UseTree, ast::ExternCrateItem> { |
203 | let src = self.definition_source(db); | 200 | let src = self.definition_source(db); |
204 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); | 201 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); |
205 | source_map.get(&src.ast, import) | 202 | source_map.get(&src.ast, import) |
@@ -321,8 +318,8 @@ pub struct StructField { | |||
321 | 318 | ||
322 | #[derive(Debug)] | 319 | #[derive(Debug)] |
323 | pub enum FieldSource { | 320 | pub enum FieldSource { |
324 | Named(TreeArc<ast::NamedFieldDef>), | 321 | Named(ast::NamedFieldDef), |
325 | Pos(TreeArc<ast::PosFieldDef>), | 322 | Pos(ast::PosFieldDef), |
326 | } | 323 | } |
327 | 324 | ||
328 | impl StructField { | 325 | impl StructField { |
@@ -736,7 +733,7 @@ impl ConstData { | |||
736 | konst: Const, | 733 | konst: Const, |
737 | ) -> Arc<ConstData> { | 734 | ) -> Arc<ConstData> { |
738 | let node = konst.source(db).ast; | 735 | let node = konst.source(db).ast; |
739 | const_data_for(&*node) | 736 | const_data_for(&node) |
740 | } | 737 | } |
741 | 738 | ||
742 | pub(crate) fn static_data_query( | 739 | pub(crate) fn static_data_query( |
@@ -744,7 +741,7 @@ impl ConstData { | |||
744 | konst: Static, | 741 | konst: Static, |
745 | ) -> Arc<ConstData> { | 742 | ) -> Arc<ConstData> { |
746 | let node = konst.source(db).ast; | 743 | let node = konst.source(db).ast; |
747 | const_data_for(&*node) | 744 | const_data_for(&node) |
748 | } | 745 | } |
749 | } | 746 | } |
750 | 747 | ||