diff options
Diffstat (limited to 'crates/hir_def/src/nameres.rs')
-rw-r--r-- | crates/hir_def/src/nameres.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index f92232eb3..6a3456f2e 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -417,6 +417,8 @@ mod diagnostics { | |||
417 | 417 | ||
418 | UnresolvedProcMacro { ast: MacroCallKind }, | 418 | UnresolvedProcMacro { ast: MacroCallKind }, |
419 | 419 | ||
420 | UnresolvedMacroCall { ast: AstId<ast::MacroCall> }, | ||
421 | |||
420 | MacroError { ast: MacroCallKind, message: String }, | 422 | MacroError { ast: MacroCallKind, message: String }, |
421 | } | 423 | } |
422 | 424 | ||
@@ -477,6 +479,13 @@ mod diagnostics { | |||
477 | Self { in_module: container, kind: DiagnosticKind::MacroError { ast, message } } | 479 | Self { in_module: container, kind: DiagnosticKind::MacroError { ast, message } } |
478 | } | 480 | } |
479 | 481 | ||
482 | pub(super) fn unresolved_macro_call( | ||
483 | container: LocalModuleId, | ||
484 | ast: AstId<ast::MacroCall>, | ||
485 | ) -> Self { | ||
486 | Self { in_module: container, kind: DiagnosticKind::UnresolvedMacroCall { ast } } | ||
487 | } | ||
488 | |||
480 | pub(super) fn add_to( | 489 | pub(super) fn add_to( |
481 | &self, | 490 | &self, |
482 | db: &dyn DefDatabase, | 491 | db: &dyn DefDatabase, |
@@ -589,6 +598,11 @@ mod diagnostics { | |||
589 | }); | 598 | }); |
590 | } | 599 | } |
591 | 600 | ||
601 | DiagnosticKind::UnresolvedMacroCall { ast } => { | ||
602 | let node = ast.to_node(db.upcast()); | ||
603 | sink.push(UnresolvedMacroCall { file: ast.file_id, node: AstPtr::new(&node) }); | ||
604 | } | ||
605 | |||
592 | DiagnosticKind::MacroError { ast, message } => { | 606 | DiagnosticKind::MacroError { ast, message } => { |
593 | let (file, ast) = match ast { | 607 | let (file, ast) = match ast { |
594 | MacroCallKind::FnLike(ast) => { | 608 | MacroCallKind::FnLike(ast) => { |