Merge pull request #20289 from ChayimFriedman2/expr-store-diags-macros

internal: Remove `ExpressionStoreDiagnostics::MacroError`, instead recreate it from the `MacroCallId`
This commit is contained in:
Lukas Wirth 2025-07-23 13:58:10 +00:00 committed by GitHub
commit 97593ea9c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 44 deletions

View file

@ -1972,13 +1972,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)) => {
@ -1988,10 +1982,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