aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/diagnostics.rs')
-rw-r--r--crates/ra_hir_def/src/diagnostics.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs
new file mode 100644
index 000000000..1c1ccdecb
--- /dev/null
+++ b/crates/ra_hir_def/src/diagnostics.rs
@@ -0,0 +1,28 @@
1//! Diagnostics produced by `hir_def`.
2
3use std::any::Any;
4
5use hir_expand::diagnostics::Diagnostic;
6use ra_syntax::{ast, AstPtr, SyntaxNodePtr};
7use relative_path::RelativePathBuf;
8
9use hir_expand::{HirFileId, Source};
10
11#[derive(Debug)]
12pub struct UnresolvedModule {
13 pub file: HirFileId,
14 pub decl: AstPtr<ast::Module>,
15 pub candidate: RelativePathBuf,
16}
17
18impl Diagnostic for UnresolvedModule {
19 fn message(&self) -> String {
20 "unresolved module".to_string()
21 }
22 fn source(&self) -> Source<SyntaxNodePtr> {
23 Source { file_id: self.file, ast: self.decl.into() }
24 }
25 fn as_any(&self) -> &(dyn Any + Send + 'static) {
26 self
27 }
28}