mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
internal: refactor unimplemented builtin macro diagnostic
This commit is contained in:
parent
dec207f56a
commit
d3621eeb02
4 changed files with 33 additions and 31 deletions
|
@ -32,14 +32,15 @@ macro_rules! diagnostics {
|
|||
}
|
||||
|
||||
diagnostics![
|
||||
UnresolvedModule,
|
||||
InactiveCode,
|
||||
MacroError,
|
||||
MissingFields,
|
||||
UnimplementedBuiltinMacro,
|
||||
UnresolvedExternCrate,
|
||||
UnresolvedImport,
|
||||
UnresolvedMacroCall,
|
||||
UnresolvedModule,
|
||||
UnresolvedProcMacro,
|
||||
MacroError,
|
||||
MissingFields,
|
||||
InactiveCode,
|
||||
];
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -88,26 +89,7 @@ pub struct MacroError {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct UnimplementedBuiltinMacro {
|
||||
pub file: HirFileId,
|
||||
pub node: SyntaxNodePtr,
|
||||
}
|
||||
|
||||
impl Diagnostic for UnimplementedBuiltinMacro {
|
||||
fn code(&self) -> DiagnosticCode {
|
||||
DiagnosticCode("unimplemented-builtin-macro")
|
||||
}
|
||||
|
||||
fn message(&self) -> String {
|
||||
"unimplemented built-in macro".to_string()
|
||||
}
|
||||
|
||||
fn display_source(&self) -> InFile<SyntaxNodePtr> {
|
||||
InFile::new(self.file, self.node.clone())
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &(dyn Any + Send + 'static) {
|
||||
self
|
||||
}
|
||||
pub node: InFile<SyntaxNodePtr>,
|
||||
}
|
||||
|
||||
// Diagnostic: no-such-field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue