From ea8555b1552f6c08043f84885e47a196320da376 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 19 May 2021 20:19:08 +0200 Subject: Simplify eager macro representation --- crates/hir_def/src/nameres/collector.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 221a5a556..0e741194b 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs @@ -948,20 +948,17 @@ impl DefCollector<'_> { // incrementality). let err = self.db.macro_expand_error(macro_call_id); if let Some(err) = err { - if let MacroCallId::LazyMacro(id) = macro_call_id { - let loc: MacroCallLoc = self.db.lookup_intern_macro(id); + let loc: MacroCallLoc = self.db.lookup_intern_macro(macro_call_id); - let diag = match err { - hir_expand::ExpandError::UnresolvedProcMacro => { - // Missing proc macros are non-fatal, so they are handled specially. - DefDiagnostic::unresolved_proc_macro(module_id, loc.kind) - } - _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()), - }; + let diag = match err { + hir_expand::ExpandError::UnresolvedProcMacro => { + // Missing proc macros are non-fatal, so they are handled specially. + DefDiagnostic::unresolved_proc_macro(module_id, loc.kind) + } + _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()), + }; - self.def_map.diagnostics.push(diag); - } - // FIXME: Handle eager macros. + self.def_map.diagnostics.push(diag); } // Then, fetch and process the item tree. This will reuse the expansion result from above. -- cgit v1.2.3