diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 731cc1fff..cb990f4e2 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -139,7 +139,7 @@ impl Module { | |||
139 | ) -> Either<ast::UseTree, ast::ExternCrateItem> { | 139 | ) -> Either<ast::UseTree, ast::ExternCrateItem> { |
140 | let src = self.definition_source(db); | 140 | let src = self.definition_source(db); |
141 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); | 141 | let (_, source_map) = db.raw_items_with_source_map(src.file_id); |
142 | source_map.get(&src.ast, import) | 142 | source_map.get(&src.value, import) |
143 | } | 143 | } |
144 | 144 | ||
145 | /// Returns the crate this module is part of. | 145 | /// Returns the crate this module is part of. |
@@ -206,7 +206,7 @@ impl Module { | |||
206 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), | 206 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), |
207 | crate::ModuleDef::Module(m) => { | 207 | crate::ModuleDef::Module(m) => { |
208 | // Only add diagnostics from inline modules | 208 | // Only add diagnostics from inline modules |
209 | if let ModuleSource::Module(_) = m.definition_source(db).ast { | 209 | if let ModuleSource::Module(_) = m.definition_source(db).value { |
210 | m.diagnostics(db, sink) | 210 | m.diagnostics(db, sink) |
211 | } | 211 | } |
212 | } | 212 | } |
@@ -598,10 +598,10 @@ impl FnData { | |||
598 | func: Function, | 598 | func: Function, |
599 | ) -> Arc<FnData> { | 599 | ) -> Arc<FnData> { |
600 | let src = func.source(db); | 600 | let src = func.source(db); |
601 | let name = src.ast.name().map(|n| n.as_name()).unwrap_or_else(Name::missing); | 601 | let name = src.value.name().map(|n| n.as_name()).unwrap_or_else(Name::missing); |
602 | let mut params = Vec::new(); | 602 | let mut params = Vec::new(); |
603 | let mut has_self_param = false; | 603 | let mut has_self_param = false; |
604 | if let Some(param_list) = src.ast.param_list() { | 604 | if let Some(param_list) = src.value.param_list() { |
605 | if let Some(self_param) = param_list.self_param() { | 605 | if let Some(self_param) = param_list.self_param() { |
606 | let self_type = if let Some(type_ref) = self_param.ascribed_type() { | 606 | let self_type = if let Some(type_ref) = self_param.ascribed_type() { |
607 | TypeRef::from_ast(type_ref) | 607 | TypeRef::from_ast(type_ref) |
@@ -625,7 +625,7 @@ impl FnData { | |||
625 | params.push(type_ref); | 625 | params.push(type_ref); |
626 | } | 626 | } |
627 | } | 627 | } |
628 | let ret_type = if let Some(type_ref) = src.ast.ret_type().and_then(|rt| rt.type_ref()) { | 628 | let ret_type = if let Some(type_ref) = src.value.ret_type().and_then(|rt| rt.type_ref()) { |
629 | TypeRef::from_ast(type_ref) | 629 | TypeRef::from_ast(type_ref) |
630 | } else { | 630 | } else { |
631 | TypeRef::unit() | 631 | TypeRef::unit() |
@@ -801,7 +801,7 @@ impl ConstData { | |||
801 | db: &(impl DefDatabase + AstDatabase), | 801 | db: &(impl DefDatabase + AstDatabase), |
802 | konst: Const, | 802 | konst: Const, |
803 | ) -> Arc<ConstData> { | 803 | ) -> Arc<ConstData> { |
804 | let node = konst.source(db).ast; | 804 | let node = konst.source(db).value; |
805 | const_data_for(&node) | 805 | const_data_for(&node) |
806 | } | 806 | } |
807 | 807 | ||
@@ -809,7 +809,7 @@ impl ConstData { | |||
809 | db: &(impl DefDatabase + AstDatabase), | 809 | db: &(impl DefDatabase + AstDatabase), |
810 | konst: Static, | 810 | konst: Static, |
811 | ) -> Arc<ConstData> { | 811 | ) -> Arc<ConstData> { |
812 | let node = konst.source(db).ast; | 812 | let node = konst.source(db).value; |
813 | const_data_for(&node) | 813 | const_data_for(&node) |
814 | } | 814 | } |
815 | } | 815 | } |