Skip to content

Commit 02f1e2a

Browse files
authored
Rollup merge of #114128 - estebank:delayed-span-bug-dump, r=davidtwco
When flushing delayed span bugs, write to the ICE dump file even if it doesn't exist Fix #113881.
2 parents a1fb861 + 656213c commit 02f1e2a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_errors/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1655,11 +1655,11 @@ impl HandlerInner {
16551655
let backtrace = std::env::var_os("RUST_BACKTRACE").map_or(true, |x| &x != "0");
16561656
for bug in bugs {
16571657
if let Some(file) = self.ice_file.as_ref()
1658-
&& let Ok(mut out) = std::fs::File::options().append(true).open(file)
1658+
&& let Ok(mut out) = std::fs::File::options().create(true).append(true).open(file)
16591659
{
16601660
let _ = write!(
16611661
&mut out,
1662-
"\n\ndelayed span bug: {}\n{}",
1662+
"delayed span bug: {}\n{}\n",
16631663
bug.inner.styled_message().iter().filter_map(|(msg, _)| msg.as_str()).collect::<String>(),
16641664
&bug.note
16651665
);

library/std/src/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ pub fn panic_hook_with_disk_dump(info: &PanicInfo<'_>, path: Option<&crate::path
300300
};
301301

302302
if let Some(path) = path
303-
&& let Ok(mut out) = crate::fs::File::options().create(true).write(true).open(&path)
303+
&& let Ok(mut out) = crate::fs::File::options().create(true).append(true).open(&path)
304304
{
305305
write(&mut out, BacktraceStyle::full());
306306
}

0 commit comments

Comments
 (0)