diff options
| author | tamasfe <me@tamasfe.dev> | 2023-11-17 15:55:55 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-02-12 12:50:44 +0100 |
| commit | ab50ec9863689524f2b8bb44b3e20e73ff27aafd (patch) | |
| tree | 60b37e0b67372ff9c8d178d7f99ab3e03ba1550b | |
| parent | 6d45afd8d8a27b835045fe75035336f7d42fe195 (diff) | |
| download | rust-ab50ec9863689524f2b8bb44b3e20e73ff27aafd.tar.gz rust-ab50ec9863689524f2b8bb44b3e20e73ff27aafd.zip | |
fix(macros): no diagnostics for disabled macro
| -rw-r--r-- | crates/hir-def/src/nameres/collector.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir-def/src/nameres/collector.rs b/crates/hir-def/src/nameres/collector.rs index d3c8c813640..7a957e86942 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 @@ -1179,6 +1179,9 @@ impl DefCollector<'_> { res = ReachedFixedPoint::No; return false; + } else if expander.is_disabled() { + res = ReachedFixedPoint::No; + return false; } } |
