From cb5454db86bae1e97d86b05607b5c36a89fb749b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 30 May 2021 04:19:47 +0200 Subject: Diagnose unimplemented built-in macros --- crates/hir/src/diagnostics.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'crates/hir/src/diagnostics.rs') diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs index 22ec7c6ac..2cdbd172a 100644 --- a/crates/hir/src/diagnostics.rs +++ b/crates/hir/src/diagnostics.rs @@ -227,3 +227,27 @@ impl Diagnostic for MacroError { true } } + +#[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 { + InFile::new(self.file, self.node.clone()) + } + + fn as_any(&self) -> &(dyn Any + Send + 'static) { + self + } +} -- cgit v1.2.3