diff options
Diffstat (limited to 'crates/hir_def/src/nameres')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index 54e9c8d20..be645a25d 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -952,20 +952,17 @@ impl DefCollector<'_> { | |||
952 | // incrementality). | 952 | // incrementality). |
953 | let err = self.db.macro_expand_error(macro_call_id); | 953 | let err = self.db.macro_expand_error(macro_call_id); |
954 | if let Some(err) = err { | 954 | if let Some(err) = err { |
955 | if let MacroCallId::LazyMacro(id) = macro_call_id { | 955 | let loc: MacroCallLoc = self.db.lookup_intern_macro(macro_call_id); |
956 | let loc: MacroCallLoc = self.db.lookup_intern_macro(id); | ||
957 | 956 | ||
958 | let diag = match err { | 957 | let diag = match err { |
959 | hir_expand::ExpandError::UnresolvedProcMacro => { | 958 | hir_expand::ExpandError::UnresolvedProcMacro => { |
960 | // Missing proc macros are non-fatal, so they are handled specially. | 959 | // Missing proc macros are non-fatal, so they are handled specially. |
961 | DefDiagnostic::unresolved_proc_macro(module_id, loc.kind) | 960 | DefDiagnostic::unresolved_proc_macro(module_id, loc.kind) |
962 | } | 961 | } |
963 | _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()), | 962 | _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()), |
964 | }; | 963 | }; |
965 | 964 | ||
966 | self.def_map.diagnostics.push(diag); | 965 | self.def_map.diagnostics.push(diag); |
967 | } | ||
968 | // FIXME: Handle eager macros. | ||
969 | } | 966 | } |
970 | 967 | ||
971 | // Then, fetch and process the item tree. This will reuse the expansion result from above. | 968 | // Then, fetch and process the item tree. This will reuse the expansion result from above. |