aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-19 19:19:08 +0100
committerJonas Schievink <[email protected]>2021-05-19 19:19:08 +0100
commitea8555b1552f6c08043f84885e47a196320da376 (patch)
tree6a9644cf1375b42885cdf4680476720ce6fbd0cc /crates/hir_def
parentc7196620abd5e9bab4fbd53388da361f0f6987a1 (diff)
Simplify eager macro representation
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/nameres/collector.rs21
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 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<'_> {
948 // incrementality). 948 // incrementality).
949 let err = self.db.macro_expand_error(macro_call_id); 949 let err = self.db.macro_expand_error(macro_call_id);
950 if let Some(err) = err { 950 if let Some(err) = err {
951 if let MacroCallId::LazyMacro(id) = macro_call_id { 951 let loc: MacroCallLoc = self.db.lookup_intern_macro(macro_call_id);
952 let loc: MacroCallLoc = self.db.lookup_intern_macro(id);
953 952
954 let diag = match err { 953 let diag = match err {
955 hir_expand::ExpandError::UnresolvedProcMacro => { 954 hir_expand::ExpandError::UnresolvedProcMacro => {
956 // Missing proc macros are non-fatal, so they are handled specially. 955 // Missing proc macros are non-fatal, so they are handled specially.
957 DefDiagnostic::unresolved_proc_macro(module_id, loc.kind) 956 DefDiagnostic::unresolved_proc_macro(module_id, loc.kind)
958 } 957 }
959 _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()), 958 _ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()),
960 }; 959 };
961 960
962 self.def_map.diagnostics.push(diag); 961 self.def_map.diagnostics.push(diag);
963 }
964 // FIXME: Handle eager macros.
965 } 962 }
966 963
967 // Then, fetch and process the item tree. This will reuse the expansion result from above. 964 // Then, fetch and process the item tree. This will reuse the expansion result from above.