//! Diagnostics produced by `hir_def`. use std::any::Any; use hir_expand::diagnostics::Diagnostic; use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; use hir_expand::{HirFileId, InFile}; #[derive(Debug)] pub struct UnresolvedModule { pub file: HirFileId, pub decl: AstPtr, pub candidate: String, } impl Diagnostic for UnresolvedModule { fn name(&self) -> String { "unresolved-module".to_string() } fn message(&self) -> String { "unresolved module".to_string() } fn source(&self) -> InFile { InFile::new(self.file, self.decl.clone().into()) } fn as_any(&self) -> &(dyn Any + Send + 'static) { self } }