diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-03 21:34:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-03 21:34:50 +0000 |
commit | 4fd742d6bc23e2f61d0980e15234f09d7e715b76 (patch) | |
tree | c37d38f9313f54ea71580f6bd005f554388a57ab /crates/ra_hir/src/diagnostics.rs | |
parent | f9f1effd011b906903891c09f1cb6b2a42f73e95 (diff) | |
parent | 8922a44395482896fec0c0a47a7fac4612112d45 (diff) |
Merge #2163
2163: Move CrateDefMap to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
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>, |