A random rustc-ice-[...].txt file appeared

I was happily coding when I noticed there was a file named rustc-ice-2026-04-23T12_43_15-91677.txt between my files...

If the date there is to be trusted it appeared 4 hours before I noticed it, so I have no idea what I was doing when it happened, and I cannot recall any error or warning related to an ICE.

Is that file useful without context? Should I bother posting it somewhere so it can be investigated?

If you want to help out the Rust project, go to the issue tracker and see whether the error message in the ICE file corresponds to anything already reported.

If there is already an issue, see if it relates to what you were doing — perhaps you’ll be able to reproduce it, or just learn more about what the cause might have been.

If there is not already an issue, then the ICE report without repro still might be of value, but it’s less likely. Perhaps you could share it with us so we can comment.

This was probably caused by your IDE. I've had this happen with RustRover myself.

Hello, sorry for the delay.

I think the error is too generic... I paste it here for completeness but I haven't been able to find a related issue in the 5 minutes i spent trying. If it happens again I'll have another look.

thread 'main' panicked at /rustc-dev/80381278a08582356c13b0f52af92d27c567c230/library/core/src/slice/index.rs:1031:55:
slice index starts at 5 but ends at 3
stack backtrace:
   0:     0x75ad815335fb - <std[4a59a852748d733f]::backtrace::Backtrace>::create
   1:     0x75ad81533545 - <std[4a59a852748d733f]::backtrace::Backtrace>::force_capture
   2:     0x75ad80533468 - std[4a59a852748d733f]::panicking::update_hook::<alloc[93b8d8fb5ba894d]::boxed::Box<rustc_driver_impl[4b9adf3bfb2302c3]::install_ice_hook::{closure#1}>>::{closure#0}
   3:     0x75ad815460f2 - std[4a59a852748d733f]::panicking::panic_with_hook
   4:     0x75ad81528b48 - std[4a59a852748d733f]::panicking::panic_handler::{closure#0}
   5:     0x75ad8151d099 - std[4a59a852748d733f]::sys::backtrace::__rust_end_short_backtrace::<std[4a59a852748d733f]::panicking::panic_handler::{closure#0}, !>
   6:     0x75ad8152a5ad - __rustc[544624e4a11beeb4]::rust_begin_unwind
   7:     0x75ad7e0c6f3c - core[be7502df5fec4e11]::panicking::panic_fmt
   8:     0x75ad7f2afcfd - core[be7502df5fec4e11]::slice::index::slice_index_fail
   9:     0x75ad7fe575a5 - <annotate_snippets[f9a4c42a3e26f5a8]::renderer::styled_buffer::StyledBuffer>::replace
  10:     0x75ad82ebc642 - annotate_snippets[f9a4c42a3e26f5a8]::renderer::render::render
  11:     0x75ad831c115d - <rustc_errors[542b67403b6292db]::annotate_snippet_emitter_writer::AnnotateSnippetEmitter>::emit_messages_default
  12:     0x75ad831b9b8a - <rustc_errors[542b67403b6292db]::annotate_snippet_emitter_writer::AnnotateSnippetEmitter as rustc_errors[542b67403b6292db]::emitter::Emitter>::emit_diagnostic
  13:     0x5e9b7f3ce150 - <rustfmt_nightly[e9d572d32080fa58]::parse::session::SilentOnIgnoredFilesEmitter as rustc_errors[542b67403b6292db]::emitter::Emitter>::emit_diagnostic
  14:     0x75ad831b3aac - <rustc_errors[542b67403b6292db]::DiagCtxtInner>::emit_diagnostic::{closure#3}
  15:     0x75ad8055674f - rustc_errors[542b67403b6292db]::default_track_diagnostic::<core[be7502df5fec4e11]::option::Option<rustc_span[fbbc4c52a51cf26a]::ErrorGuaranteed>>
  16:     0x75ad831b096e - <rustc_errors[542b67403b6292db]::DiagCtxtInner>::emit_diagnostic
  17:     0x75ad831b0821 - <rustc_errors[542b67403b6292db]::DiagCtxtHandle>::emit_diagnostic
  18:     0x75ad7e2f823c - <rustc_span[fbbc4c52a51cf26a]::ErrorGuaranteed as rustc_errors[542b67403b6292db]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  19:     0x75ad82c0903d - <rustc_parse[60e680bc7706fbda]::parser::Parser>::error_on_forbidden_inner_attr
  20:     0x75ad81e3eb3d - <rustc_parse[60e680bc7706fbda]::parser::Parser>::parse_outer_attributes
  21:     0x75ad81e3c1b5 - <rustc_parse[60e680bc7706fbda]::parser::Parser>::parse_mod
  22:     0x75ad7e506093 - <rustc_parse[60e680bc7706fbda]::parser::Parser>::parse_crate_mod
  23:     0x5e9b7f341be8 - <rustfmt_nightly[e9d572d32080fa58]::parse::parser::Parser>::parse_crate
  24:     0x5e9b7f268f2d - <scoped_tls[9c58d9dc7917b59d]::ScopedKey<rustc_span[fbbc4c52a51cf26a]::SessionGlobals>>::with::<<rustfmt_nightly[e9d572d32080fa58]::Session<std[4a59a852748d733f]::io::stdio::Stdout>>::format_input_inner::{closure#0}, core[be7502df5fec4e11]::result::Result<rustfmt_nightly[e9d572d32080fa58]::FormatReport, rustfmt_nightly[e9d572d32080fa58]::ErrorKind>>
  25:     0x5e9b7f263e5f - rustfmt[bfd2b00fb2a88c86]::format_and_emit_report::<std[4a59a852748d733f]::io::stdio::Stdout>
  26:     0x5e9b7f278e45 - rustfmt[bfd2b00fb2a88c86]::execute
  27:     0x5e9b7f274716 - rustfmt[bfd2b00fb2a88c86]::main
  28:     0x5e9b7f272ca3 - std[4a59a852748d733f]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  29:     0x5e9b7f273389 - std[4a59a852748d733f]::rt::lang_start::<()>::{closure#0}
  30:     0x75ad82ddddc8 - std[4a59a852748d733f]::rt::lang_start_internal
  31:     0x5e9b7f284108 - main
  32:     0x75ad7c62a1ca - <unknown>
  33:     0x75ad7c62a28b - __libc_start_main
  34:     0x5e9b7f15f099 - <unknown>
  35:                0x0 - <unknown>


rustc version: 1.96.0-nightly (80381278a 2026-03-01)
platform: x86_64-unknown-linux-gnu

I found this issue, which should be fixed for 1.96. (However, it is also possible that your ICE has a different cause and is not fixed.)

I found this by searching in the annotate-snippets repository first.

If I had not found this issue, I would be telling you that it is worth reporting anyway, because an indexing bug like this is often obvious once attention is directed to the function that panicked. Or, if not obvious, then at least the function can be changed to produce a more informative panic upon bad input.