mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Add dedicated error for "proc macro not found"
This commit is contained in:
parent
c66d477f5a
commit
1b26520971
2 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,7 @@ impl ProcMacroExpander {
|
||||||
|
|
||||||
proc_macro.expander.expand(&tt, None).map_err(mbe::ExpandError::from)
|
proc_macro.expander.expand(&tt, None).map_err(mbe::ExpandError::from)
|
||||||
}
|
}
|
||||||
None => Err(err!("Unresolved proc macro")),
|
None => Err(mbe::ExpandError::UnresolvedProcMacro),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ pub enum ExpandError {
|
||||||
ConversionError,
|
ConversionError,
|
||||||
InvalidRepeat,
|
InvalidRepeat,
|
||||||
ProcMacroError(tt::ExpansionError),
|
ProcMacroError(tt::ExpansionError),
|
||||||
|
UnresolvedProcMacro,
|
||||||
Other(String),
|
Other(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +54,7 @@ impl fmt::Display for ExpandError {
|
||||||
ExpandError::ConversionError => f.write_str("could not convert tokens"),
|
ExpandError::ConversionError => f.write_str("could not convert tokens"),
|
||||||
ExpandError::InvalidRepeat => f.write_str("invalid repeat expression"),
|
ExpandError::InvalidRepeat => f.write_str("invalid repeat expression"),
|
||||||
ExpandError::ProcMacroError(e) => e.fmt(f),
|
ExpandError::ProcMacroError(e) => e.fmt(f),
|
||||||
|
ExpandError::UnresolvedProcMacro => f.write_str("unresolved proc macro"),
|
||||||
ExpandError::Other(e) => f.write_str(e),
|
ExpandError::Other(e) => f.write_str(e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue