mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
Add dedicated error for "proc macro not found"
This commit is contained in:
@@ -50,7 +50,7 @@ pub fn expand(
|
||||
|
||||
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,
|
||||
InvalidRepeat,
|
||||
ProcMacroError(tt::ExpansionError),
|
||||
UnresolvedProcMacro,
|
||||
Other(String),
|
||||
}
|
||||
|
||||
@@ -53,6 +54,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
ExpandError::ConversionError => f.write_str("could not convert tokens"),
|
||||
ExpandError::InvalidRepeat => f.write_str("invalid repeat expression"),
|
||||
ExpandError::ProcMacroError(e) => e.fmt(f),
|
||||
ExpandError::UnresolvedProcMacro => f.write_str("unresolved proc macro"),
|
||||
ExpandError::Other(e) => f.write_str(e),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user