mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
parse_macro_expansion_error
almost never contains values so Option
it
This commit is contained in:
parent
56552f4839
commit
caddcccea5
3 changed files with 14 additions and 8 deletions
|
@ -831,13 +831,15 @@ fn macro_call_diagnostics(
|
|||
macro_call_id: MacroCallId,
|
||||
acc: &mut Vec<AnyDiagnostic>,
|
||||
) {
|
||||
let ValueResult { value: parse_errors, err } = db.parse_macro_expansion_error(macro_call_id);
|
||||
|
||||
let Some(e) = db.parse_macro_expansion_error(macro_call_id) else {
|
||||
return;
|
||||
};
|
||||
let ValueResult { value: parse_errors, err } = &*e;
|
||||
if let Some(err) = err {
|
||||
let loc = db.lookup_intern_macro_call(macro_call_id);
|
||||
let (node, precise_location, macro_name, kind) = precise_macro_call_location(&loc.kind, db);
|
||||
let diag = match err {
|
||||
hir_expand::ExpandError::UnresolvedProcMacro(krate) => {
|
||||
&hir_expand::ExpandError::UnresolvedProcMacro(krate) => {
|
||||
UnresolvedProcMacro { node, precise_location, macro_name, kind, krate }.into()
|
||||
}
|
||||
err => MacroError { node, precise_location, message: err.to_string() }.into(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue