Move CrateDefMap to hir_def

This commit is contained in:
Aleksey Kladov 2019-10-31 18:45:10 +03:00
parent f9f1effd01
commit ba2efca2bb
23 changed files with 824 additions and 731 deletions

View file

@ -3,10 +3,10 @@
use std::any::Any;
use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr};
use relative_path::RelativePathBuf;
use crate::{db::AstDatabase, HirFileId, Name, Source};
pub use hir_def::diagnostics::UnresolvedModule;
pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink};
#[derive(Debug)]
@ -29,25 +29,6 @@ impl Diagnostic for NoSuchField {
}
}
#[derive(Debug)]
pub struct UnresolvedModule {
pub file: HirFileId,
pub decl: AstPtr<ast::Module>,
pub candidate: RelativePathBuf,
}
impl Diagnostic for UnresolvedModule {
fn message(&self) -> String {
"unresolved module".to_string()
}
fn source(&self) -> Source<SyntaxNodePtr> {
Source { file_id: self.file, ast: self.decl.into() }
}
fn as_any(&self) -> &(dyn Any + Send + 'static) {
self
}
}
#[derive(Debug)]
pub struct MissingFields {
pub file: HirFileId,