internal: refactor unimplemented builtin macro diagnostic
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user