On nightly, dump ICE backtraces to disk

Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
This commit is contained in:
Esteban Küber 2023-03-03 22:25:18 +00:00
parent 77e24f90f5
commit 8eb5843a59
30 changed files with 272 additions and 54 deletions

View file

@ -354,6 +354,13 @@ impl DiagnosticMessage {
}
}
}
pub fn as_str(&self) -> Option<&str> {
match self {
DiagnosticMessage::Eager(s) | DiagnosticMessage::Str(s) => Some(s),
DiagnosticMessage::FluentIdentifier(_, _) => None,
}
}
}
impl From<String> for DiagnosticMessage {