Skip to content

ICE when formatting indented alpha SourceAnnotation range (16, 17) is bigger than source length 16 #6419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bend-n opened this issue Dec 13, 2024 · 1 comment
Labels
a-rustfmt::skip duplicate e-trailing whitespace error[internal]: left behind trailing whitespace

Comments

@bend-n
Copy link

bend-n commented Dec 13, 2024

ICE caused by

fn x() {

        #[rustfmt::skip]
        let α = 
            0;
}
ICE logs
thread 'main' panicked at /rust/deps/annotate-snippets-0.9.2/src/display_list/from_snippet.rs:275:9:
SourceAnnotation range `(16, 17)` is bigger than source length `16`
stack backtrace:
   0:     0x7db34ad6614a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h19d069226d4e095f
   1:     0x7db34b413ba6 - core::fmt::write::he2ebc12e8a613462
   2:     0x7db34c3c02d1 - std::io::Write::write_fmt::h07403f5bfcd49bd0
   3:     0x7db34ad65fa2 - std::sys::backtrace::BacktraceLock::print::h554c9719d6927bc8
   4:     0x7db34ad684ba - std::panicking::default_hook::{{closure}}::h71a81d2da30801c6
   5:     0x7db34ad68303 - std::panicking::default_hook::h0c70b0641d4b7452
   6:     0x7db349ec9308 - std[9779fab8d3c8d815]::panicking::update_hook::<alloc[a1b14cc0d9fc374a]::boxed::Box<rustc_driver_impl[798d3fc96b2b8d4]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7db34ad68c78 - std::panicking::rust_panic_with_hook::heddaba3bf93a8bea
   8:     0x7db34ad6896a - std::panicking::begin_panic_handler::{{closure}}::h582671a4c5a36641
   9:     0x7db34ad665e9 - std::sys::backtrace::__rust_end_short_backtrace::ha165e65ad2cb2750
  10:     0x7db34ad6862d - rust_begin_unwind
  11:     0x7db3479badb0 - core::panicking::panic_fmt::h80045ba836638a48
  12:     0x579be46f85a4 - <annotate_snippets[96830faa08ecbf93]::display_list::structs::DisplayList as core[c52cd8cf03e26d76]::convert::From<annotate_snippets[96830faa08ecbf93]::snippet::Snippet>>::from
  13:     0x579be45242a4 - <rustfmt_nightly[965367e8fd2fc788]::format_report_formatter::FormatReportFormatter as core[c52cd8cf03e26d76]::fmt::Display>::fmt
  14:     0x7db34b413ba6 - core::fmt::write::he2ebc12e8a613462
  15:     0x7db34ad5a80e - <&std::io::stdio::Stderr as std::io::Write>::write_fmt::hfabb34c90e4dac97
  16:     0x7db34ad5b198 - std::io::stdio::_eprint::h0e966ee395ef2e9a
  17:     0x579be441dac3 - rustfmt[f464f249c388c4b0]::format_and_emit_report::<std[9779fab8d3c8d815]::io::stdio::Stdout>
  18:     0x579be441b4d2 - rustfmt[f464f249c388c4b0]::execute
  19:     0x579be44174d3 - rustfmt[f464f249c388c4b0]::main
  20:     0x579be440ba23 - std[9779fab8d3c8d815]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  21:     0x579be440bfa9 - std[9779fab8d3c8d815]::rt::lang_start::<()>::{closure#0}
  22:     0x7db34c31c2c4 - std::rt::lang_start_internal::hcf33a6f34c70ce9a
  23:     0x579be441eb28 - main
  24:     0x7db346545e08 - <unknown>
  25:     0x7db346545ecc - __libc_start_main
  26:     0x579be43ff259 - <unknown>
  27:                0x0 - <unknown>

rustc version: 1.85.0-nightly (d4025ee45 2024-12-12)
platform: x86_64-unknown-linux-gnu

rustc-ice-2024-12-13T07_21_21-479925.txt

@ytmimi ytmimi added duplicate a-rustfmt::skip e-trailing whitespace error[internal]: left behind trailing whitespace labels Dec 13, 2024
@ytmimi
Copy link
Contributor

ytmimi commented Dec 13, 2024

Duplicate of #6409 and related issues.

@ytmimi ytmimi closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-rustfmt::skip duplicate e-trailing whitespace error[internal]: left behind trailing whitespace
Projects
None yet
Development

No branches or pull requests

2 participants