Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/diagnostics.rs')
-rw-r--r--crates/hir/src/diagnostics.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index b735decfcb..f81f8b0b01 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -10,7 +10,7 @@ use cfg::{CfgExpr, CfgOptions};
use either::Either;
use hir_def::path::ModPath;
use hir_expand::{name::Name, HirFileId, InFile};
-use syntax::{ast, AstPtr, SyntaxNodePtr, TextRange};
+use syntax::{ast, AstPtr, SyntaxError, SyntaxNodePtr, TextRange};
use crate::{AssocItem, Field, Local, MacroKind, Type};
@@ -38,8 +38,9 @@ diagnostics![
IncorrectCase,
InvalidDeriveTarget,
IncoherentImpl,
- MacroError,
MacroDefError,
+ MacroError,
+ MacroExpansionParseError,
MalformedDerive,
MismatchedArgCount,
MissingFields,
@@ -133,6 +134,13 @@ pub struct MacroError {
}
#[derive(Debug, Clone, Eq, PartialEq)]
+pub struct MacroExpansionParseError {
+ pub node: InFile<SyntaxNodePtr>,
+ pub precise_location: Option<TextRange>,
+ pub errors: Box<[SyntaxError]>,
+}
+
+#[derive(Debug, Clone, Eq, PartialEq)]
pub struct MacroDefError {
pub node: InFile<AstPtr<ast::Macro>>,
pub message: String,