diff options
Diffstat (limited to 'crates/ra_hir/src/diagnostics.rs')
-rw-r--r-- | crates/ra_hir/src/diagnostics.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index a33af8f46..1751e7be3 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs | |||
@@ -3,10 +3,10 @@ | |||
3 | use std::any::Any; | 3 | use std::any::Any; |
4 | 4 | ||
5 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; | 5 | use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; |
6 | use relative_path::RelativePathBuf; | ||
7 | 6 | ||
8 | use crate::{db::AstDatabase, HirFileId, Name, Source}; | 7 | use crate::{db::AstDatabase, HirFileId, Name, Source}; |
9 | 8 | ||
9 | pub use hir_def::diagnostics::UnresolvedModule; | ||
10 | pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink}; | 10 | pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink}; |
11 | 11 | ||
12 | #[derive(Debug)] | 12 | #[derive(Debug)] |
@@ -30,25 +30,6 @@ impl Diagnostic for NoSuchField { | |||
30 | } | 30 | } |
31 | 31 | ||
32 | #[derive(Debug)] | 32 | #[derive(Debug)] |
33 | pub struct UnresolvedModule { | ||
34 | pub file: HirFileId, | ||
35 | pub decl: AstPtr<ast::Module>, | ||
36 | pub candidate: RelativePathBuf, | ||
37 | } | ||
38 | |||
39 | impl Diagnostic for UnresolvedModule { | ||
40 | fn message(&self) -> String { | ||
41 | "unresolved module".to_string() | ||
42 | } | ||
43 | fn source(&self) -> Source<SyntaxNodePtr> { | ||
44 | Source { file_id: self.file, ast: self.decl.into() } | ||
45 | } | ||
46 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | ||
47 | self | ||
48 | } | ||
49 | } | ||
50 | |||
51 | #[derive(Debug)] | ||
52 | pub struct MissingFields { | 33 | pub struct MissingFields { |
53 | pub file: HirFileId, | 34 | pub file: HirFileId, |
54 | pub field_list: AstPtr<ast::RecordFieldList>, | 35 | pub field_list: AstPtr<ast::RecordFieldList>, |