Aurora
April 23, 2026, 2:30pm
1
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?
kpreid
April 23, 2026, 3:11pm
2
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.)
opened 11:28AM - 23 Mar 26 UTC
closed 01:29PM - 08 Apr 26 UTC
A-diagnostics
I-ICE
P-low
T-compiler
regression-from-stable-to-stable
C-bug
D-diagnostic-infra
## Code
```rust
pub fn f() { let mut foo_bar = 0; }
```
## Meta
`rustc --vers… ion --verbose`:
```
rustc 1.94.0 (4a4ef493e 2026-03-02)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: x86_64-unknown-linux-gnu
release: 1.94.0
LLVM version: 21.1.8
```
## Error output
```
$ rustc --edition=2021 --crate-type lib --diagnostic-width=0 ice.rs
thread 'rustc' panicked at library/alloc/src/vec/mod.rs:2873:36:
slice index starts at 13 but ends at 11
...
12: <annotate_snippets::renderer::styled_buffer::StyledBuffer>::replace
13: annotate_snippets::renderer::render::render
14: <rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter>::emit_messages_default
...
21: rustc_middle::lint::lint_level::lint_level_impl
22: rustc_borrowck::borrowck_check_region_constraints
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new
note: rustc 1.94.0 (4a4ef493e 2026-03-02) running on x86_64-unknown-linux-gnu
```
<details>
<summary>Full backtrace</summary>
```
0: <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{closure}
4: std::panicking::default_hook
5: std::panicking::update_hook::<Box<rustc_driver_impl::install_ice_hook::{closure#1}>>::{closure#0}
6: std::panicking::panic_with_hook
7: std::panicking::panic_handler::{closure}
8: std::sys::backtrace::__rust_end_short_backtrace
9: __rustc::rust_begin_unwind
10: core::panicking::panic_fmt
11: core::slice::index::slice_index_fail
12: <annotate_snippets::renderer::styled_buffer::StyledBuffer>::replace
13: annotate_snippets::renderer::render::render
14: <rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter>::emit_messages_default
15: <AnnotateSnippetEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
16: <rustc_errors::DiagCtxtInner>::emit_diagnostic::{closure#3}
17: rustc_interface::callbacks::track_diagnostic::<Option<ErrorGuaranteed>>
18: <rustc_errors::DiagCtxtInner>::emit_diagnostic
19: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
20: <() as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
21: rustc_middle::lint::lint_level::lint_level_impl
22: rustc_borrowck::borrowck_check_region_constraints
23: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
```
</details>
## Trigger conditions
- Any `unused_mut` warning where the variable name is 7+ characters (the lint's underline spans 12+ display columns)
- `--diagnostic-width` is 10 or less (including 0, the auto-detected value when there is no TTY)
This is hit in practice by non-interactive environments: CI without a PTY, `wsl -e` invocations, piped output through tools that don't allocate a terminal, etc.
The crash also produces a secondary `delayed_bug` about `OpaqueTypeKey` / `ProvisionalHiddenType`, but this is collateral damage from the panic aborting the borrow checker -- not an independent type system bug.
## Regression
Regression in **1.94.0** (works on 1.93.0). Nightly bisect (regressed nightly-2025-11-23) points to [#148984](https://github.com/rust-lang/rust/pull/148984) which upgraded `annotate-snippets` from 0.11.5 to 0.12.9. The vulnerable `StyledBuffer::replace` method was introduced in the 0.12.x series.
**Update:** Regression is 1.91.0 -> 1.92.0, not 1.93.0 -> 1.94.0. See [this comment](https://github.com/rust-lang/rust/issues/154258#issuecomment-4110584114) for details.
```
searched nightlies: nightly-2025-11-01 to nightly-2026-01-20
regressed nightly: nightly-2025-11-23
```
## Root cause
The bug is in `annotate-snippets` 0.12.10-0.12.13 (still present on main), not in rustc itself. The span-trimming logic in `annotate_snippets::renderer::render` computes an inverted range when `term_width` is 0, and `StyledBuffer::replace` panics on it.
Filed upstream: https://github.com/rust-lang/annotate-snippets-rs/issues/391
## Workarounds
```bash
RUSTFLAGS="--diagnostic-width=80" cargo build # explicit width
RUSTFLAGS="-A unused-mut" cargo build # suppress the lint
rustup override set 1.93.0 # pin toolchain
```
## Reproducer repo
https://github.com/furkanmamuk/rustc-ice-diagnostic-width-panic
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.