aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/diagnostics.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-03 21:34:50 +0000
committerGitHub <[email protected]>2019-11-03 21:34:50 +0000
commit4fd742d6bc23e2f61d0980e15234f09d7e715b76 (patch)
treec37d38f9313f54ea71580f6bd005f554388a57ab /crates/ra_hir/src/diagnostics.rs
parentf9f1effd011b906903891c09f1cb6b2a42f73e95 (diff)
parent8922a44395482896fec0c0a47a7fac4612112d45 (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.rs21
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 @@
3use std::any::Any; 3use std::any::Any;
4 4
5use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; 5use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr};
6use relative_path::RelativePathBuf;
7 6
8use crate::{db::AstDatabase, HirFileId, Name, Source}; 7use crate::{db::AstDatabase, HirFileId, Name, Source};
9 8
9pub use hir_def::diagnostics::UnresolvedModule;
10pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink}; 10pub 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)]
33pub struct UnresolvedModule {
34 pub file: HirFileId,
35 pub decl: AstPtr<ast::Module>,
36 pub candidate: RelativePathBuf,
37}
38
39impl 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)]
52pub struct MissingFields { 33pub struct MissingFields {
53 pub file: HirFileId, 34 pub file: HirFileId,
54 pub field_list: AstPtr<ast::RecordFieldList>, 35 pub field_list: AstPtr<ast::RecordFieldList>,