mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
fix: Report proc macro errors in expressions correctly as well
They didn't have a krate before, resulting in the generic "proc macro not found" error. Also improve error messages a bit more.
This commit is contained in:
parent
9eaf96c9ea
commit
8b3ec12aac
12 changed files with 69 additions and 69 deletions
|
@ -43,7 +43,7 @@ pub type ExpandResult<T> = ValueResult<T, ExpandError>;
|
|||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum ExpandError {
|
||||
UnresolvedProcMacro,
|
||||
UnresolvedProcMacro(CrateId),
|
||||
Mbe(mbe::ExpandError),
|
||||
Other(Box<str>),
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ impl From<mbe::ExpandError> for ExpandError {
|
|||
impl fmt::Display for ExpandError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
ExpandError::UnresolvedProcMacro => f.write_str("unresolved proc-macro"),
|
||||
ExpandError::UnresolvedProcMacro(_) => f.write_str("unresolved proc-macro"),
|
||||
ExpandError::Mbe(it) => it.fmt(f),
|
||||
ExpandError::Other(it) => f.write_str(it),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue