fix: Don't print proc-macro panic backtraces in the logs

This commit is contained in:
Lukas Wirth 2023-12-06 17:39:41 +01:00
parent ba01ff4f88
commit 80dc20f7d8
11 changed files with 41 additions and 42 deletions

View file

@ -78,6 +78,7 @@ pub enum ExpandError {
Mbe(mbe::ExpandError),
RecursionOverflowPoisoned,
Other(Box<Box<str>>),
ProcMacroPanic(Box<Box<str>>),
}
impl ExpandError {
@ -100,6 +101,10 @@ impl fmt::Display for ExpandError {
ExpandError::RecursionOverflowPoisoned => {
f.write_str("overflow expanding the original macro")
}
ExpandError::ProcMacroPanic(it) => {
f.write_str("proc-macro panicked: ")?;
f.write_str(it)
}
ExpandError::Other(it) => f.write_str(it),
}
}