mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Move CrateDefMap to hir_def
This commit is contained in:
parent
f9f1effd01
commit
ba2efca2bb
23 changed files with 824 additions and 731 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue