Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 6dd1801dae..079aa90600 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -831,13 +831,15 @@ fn macro_call_diagnostics(
macro_call_id: MacroCallId,
acc: &mut Vec<AnyDiagnostic>,
) {
- let ValueResult { value: parse_errors, err } = db.parse_macro_expansion_error(macro_call_id);
-
+ let Some(e) = db.parse_macro_expansion_error(macro_call_id) else {
+ return;
+ };
+ let ValueResult { value: parse_errors, err } = &*e;
if let Some(err) = err {
let loc = db.lookup_intern_macro_call(macro_call_id);
let (node, precise_location, macro_name, kind) = precise_macro_call_location(&loc.kind, db);
let diag = match err {
- hir_expand::ExpandError::UnresolvedProcMacro(krate) => {
+ &hir_expand::ExpandError::UnresolvedProcMacro(krate) => {
UnresolvedProcMacro { node, precise_location, macro_name, kind, krate }.into()
}
err => MacroError { node, precise_location, message: err.to_string() }.into(),