Remove ExpressionStoreDiagnostics::MacroError, instead recreate it from the MacroCallId

This simplifies the code and also makes us report parse error in macros too.
This commit is contained in:
Chayim Refael Friedman 2025-07-23 16:27:07 +03:00
parent a54351effd
commit 963a1317e7
3 changed files with 9 additions and 44 deletions

View file

@ -1981,13 +1981,7 @@ impl ExprCollector<'_> {
return collector(self, None);
}
};
if record_diagnostics {
if let Some(err) = res.err {
self.store
.diagnostics
.push(ExpressionStoreDiagnostics::MacroError { node: macro_call_ptr, err });
}
}
// No need to push macro and parsing errors as they'll be recreated from `macro_calls()`.
match res.value {
Some((mark, expansion)) => {
@ -1997,10 +1991,6 @@ impl ExprCollector<'_> {
self.store.expansions.insert(macro_call_ptr, macro_file);
}
if record_diagnostics {
// FIXME: Report parse errors here
}
let id = collector(self, expansion.map(|it| it.tree()));
self.expander.exit(mark);
id