about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-28 19:51:15 +0200
committerGitHub <noreply@github.com>2023-07-28 19:51:15 +0200
commit02f1e2ada7a2c225853707a9685b71deefbe7dbd (patch)
treeae40b2c3730ba491fbf1519f2747a46f64759ced /compiler/rustc_errors
parenta1fb86144da900cded8e82598a60cce589c7fbcd (diff)
parent656213cc83537c311d8bcfd0b8f2c68fe1594233 (diff)
downloadrust-02f1e2ada7a2c225853707a9685b71deefbe7dbd.tar.gz
rust-02f1e2ada7a2c225853707a9685b71deefbe7dbd.zip
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.
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index e01e80939ca..aa213cd0720 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -1655,11 +1655,11 @@ impl HandlerInner {
         let backtrace = std::env::var_os("RUST_BACKTRACE").map_or(true, |x| &x != "0");
         for bug in bugs {
             if let Some(file) = self.ice_file.as_ref()
-                && let Ok(mut out) = std::fs::File::options().append(true).open(file)
+                && let Ok(mut out) = std::fs::File::options().create(true).append(true).open(file)
             {
                 let _ = write!(
                     &mut out,
-                    "\n\ndelayed span bug: {}\n{}",
+                    "delayed span bug: {}\n{}\n",
                     bug.inner.styled_message().iter().filter_map(|(msg, _)| msg.as_str()).collect::<String>(),
                     &bug.note
                 );