From ab50ec9863689524f2b8bb44b3e20e73ff27aafd Mon Sep 17 00:00:00 2001 From: tamasfe Date: Fri, 17 Nov 2023 15:55:55 +0100 Subject: [PATCH] fix(macros): no diagnostics for disabled macro --- crates/hir-def/src/nameres/collector.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/hir-def/src/nameres/collector.rs b/crates/hir-def/src/nameres/collector.rs index d3c8c813640d..7a957e869426 100644 --- a/crates/hir-def/src/nameres/collector.rs +++ b/crates/hir-def/src/nameres/collector.rs @@ -1164,7 +1164,7 @@ impl DefCollector<'_> { let loc: MacroCallLoc = self.db.lookup_intern_macro_call(call_id); if let MacroDefKind::ProcMacro(expander, _, _) = loc.def.kind { - if expander.is_dummy() || expander.is_disabled() { + if expander.is_dummy() { // If there's no expander for the proc macro (e.g. // because proc macros are disabled, or building the // proc macro crate failed), report this and skip @@ -1177,6 +1177,9 @@ impl DefCollector<'_> { ), ); + res = ReachedFixedPoint::No; + return false; + } else if expander.is_disabled() { res = ReachedFixedPoint::No; return false; }