diff options
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 14 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 4a13fac23..5054189cc 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::any::Any; | 3 | use std::any::Any; |
4 | 4 | ||
5 | use hir_expand::{db::AstDatabase, name::Name, HirFileId, Source}; | 5 | use hir_expand::{db::AstDatabase, name::Name, HirFileId, InFile}; |
6 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; | 6 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; |
7 | 7 | ||
8 | pub use hir_def::diagnostics::UnresolvedModule; | 8 | pub use hir_def::diagnostics::UnresolvedModule; |
@@ -19,8 +19,8 @@ impl Diagnostic for NoSuchField { | |||
19 | "no such field".to_string() | 19 | "no such field".to_string() |
20 | } | 20 | } |
21 | 21 | ||
22 | fn source(&self) -> Source<SyntaxNodePtr> { | 22 | fn source(&self) -> InFile<SyntaxNodePtr> { |
23 | Source { file_id: self.file, value: self.field.into() } | 23 | InFile { file_id: self.file, value: self.field.into() } |
24 | } | 24 | } |
25 | 25 | ||
26 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 26 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
@@ -44,8 +44,8 @@ impl Diagnostic for MissingFields { | |||
44 | } | 44 | } |
45 | message | 45 | message |
46 | } | 46 | } |
47 | fn source(&self) -> Source<SyntaxNodePtr> { | 47 | fn source(&self) -> InFile<SyntaxNodePtr> { |
48 | Source { file_id: self.file, value: self.field_list.into() } | 48 | InFile { file_id: self.file, value: self.field_list.into() } |
49 | } | 49 | } |
50 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 50 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
51 | self | 51 | self |
@@ -72,8 +72,8 @@ impl Diagnostic for MissingOkInTailExpr { | |||
72 | fn message(&self) -> String { | 72 | fn message(&self) -> String { |
73 | "wrap return expression in Ok".to_string() | 73 | "wrap return expression in Ok".to_string() |
74 | } | 74 | } |
75 | fn source(&self) -> Source<SyntaxNodePtr> { | 75 | fn source(&self) -> InFile<SyntaxNodePtr> { |
76 | Source { file_id: self.file, value: self.expr.into() } | 76 | InFile { file_id: self.file, value: self.expr.into() } |
77 | } | 77 | } |
78 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 78 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
79 | self | 79 | self |
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index c8461b447..abbc1546c 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -8,7 +8,7 @@ use hir_def::{ | |||
8 | body::BodySourceMap, db::DefDatabase, nameres::CrateDefMap, AssocItemId, DefWithBodyId, | 8 | body::BodySourceMap, db::DefDatabase, nameres::CrateDefMap, AssocItemId, DefWithBodyId, |
9 | LocalModuleId, Lookup, ModuleDefId, | 9 | LocalModuleId, Lookup, ModuleDefId, |
10 | }; | 10 | }; |
11 | use hir_expand::Source; | 11 | use hir_expand::InFile; |
12 | use insta::assert_snapshot; | 12 | use insta::assert_snapshot; |
13 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; | 13 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; |
14 | use ra_syntax::{ | 14 | use ra_syntax::{ |
@@ -4680,7 +4680,7 @@ fn type_at_pos(db: &TestDB, pos: FilePosition) -> String { | |||
4680 | for decl in crate_def_map[module.local_id].scope.declarations() { | 4680 | for decl in crate_def_map[module.local_id].scope.declarations() { |
4681 | if let ModuleDefId::FunctionId(func) = decl { | 4681 | if let ModuleDefId::FunctionId(func) = decl { |
4682 | let (_body, source_map) = db.body_with_source_map(func.into()); | 4682 | let (_body, source_map) = db.body_with_source_map(func.into()); |
4683 | if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { | 4683 | if let Some(expr_id) = source_map.node_expr(InFile::new(pos.file_id.into(), &expr)) { |
4684 | let infer = db.infer(func.into()); | 4684 | let infer = db.infer(func.into()); |
4685 | let ty = &infer[expr_id]; | 4685 | let ty = &infer[expr_id]; |
4686 | return ty.display(db).to_string(); | 4686 | return ty.display(db).to_string(); |