mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 02:52:11 +00:00
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:
parent
a54351effd
commit
963a1317e7
3 changed files with 9 additions and 44 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue