Skip to content

ICE: rustdoc: panicked at 'index out of bounds: the len is 0 but the index is 0 search_index.rs #106213

Closed

Description

@matthiaskrgr

Code

fn use_avx() -> dyn  {
    !( ident_error )
}

Meta

rustc --version --verbose:

 1.68.0-nightly (92c1937a9 2022-12-27)

Error output

rustdoc --document-private-items --edition=2021 <file>

<output>
Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', src/librustdoc/html/render/search_index.rs:325:25
stack backtrace:
   0:     0x7f8aae0793da - std::backtrace_rs::backtrace::libunwind::trace::hd9920c45cab02727
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8aae0793da - std::backtrace_rs::backtrace::trace_unsynchronized::h0e8ba232432f278b
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8aae0793da - std::sys_common::backtrace::_print_fmt::h70b1bf152d50d826
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8aae0793da - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0f8a00c5ac0ea98c
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8aae0dc62e - core::fmt::write::h75194d37b0340e77
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f8aae069885 - std::io::Write::write_fmt::h019baaeffa3c233d
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/io/mod.rs:1682:15
   6:     0x7f8aae0791a5 - std::sys_common::backtrace::_print::hd2cb40128730a76d
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8aae0791a5 - std::sys_common::backtrace::print::h30c90b179f5588ff
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8aae07bf6f - std::panicking::default_hook::{{closure}}::hb4605418c1ac9dde
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/panicking.rs:267:22
   9:     0x7f8aae07bcab - std::panicking::default_hook::h911627d2c5874d29
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/panicking.rs:286:9
  10:     0x7f8aace6ce4f - rustc_driver[be31376d096510e8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f8aae07c7ad - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h30886b880f16ecd7
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/alloc/src/boxed.rs:2032:9
  12:     0x7f8aae07c7ad - std::panicking::rust_panic_with_hook::h7c2b44024a401155
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/panicking.rs:692:13
  13:     0x7f8aae07c529 - std::panicking::begin_panic_handler::{{closure}}::h8e64ae5b7bafe3c0
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/panicking.rs:579:13
  14:     0x7f8aae07988c - std::sys_common::backtrace::__rust_end_short_backtrace::hd43ee2e6b4a0d8d6
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f8aae07c232 - rust_begin_unwind
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/panicking.rs:575:5
  16:     0x7f8aae0d9013 - core::panicking::panic_fmt::hfd723e1f10b23e9d
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/core/src/panicking.rs:64:14
  17:     0x7f8aae0d91e2 - core::panicking::panic_bounds_check::h8a845910d11289b5
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/core/src/panicking.rs:148:5
  18:     0x55609f53ba87 - rustdoc[8f23bbef6cf7efb7]::html::render::search_index::get_index_type
  19:     0x55609f554cfb - rustdoc[8f23bbef6cf7efb7]::html::render::search_index::add_generics_and_bounds_as_types::insert_ty
  20:     0x55609f55432a - rustdoc[8f23bbef6cf7efb7]::html::render::search_index::add_generics_and_bounds_as_types
  21:     0x55609f53c22f - rustdoc[8f23bbef6cf7efb7]::html::render::search_index::get_fn_inputs_and_outputs
  22:     0x55609f53b82d - rustdoc[8f23bbef6cf7efb7]::html::render::search_index::get_function_type_for_search
  23:     0x55609f7c868e - <rustdoc[8f23bbef6cf7efb7]::formats::cache::CacheBuilder as rustdoc[8f23bbef6cf7efb7]::fold::DocFolder>::fold_item
  24:     0x55609f591c58 - <alloc[c40375f0f7ff5c91]::vec::Vec<rustdoc[8f23bbef6cf7efb7]::clean::types::Item> as alloc[c40375f0f7ff5c91]::vec::spec_from_iter::SpecFromIter<rustdoc[8f23bbef6cf7efb7]::clean::types::Item, core[468623a6da7d9ec9]::iter::adapters::filter_map::FilterMap<alloc[c40375f0f7ff5c91]::vec::into_iter::IntoIter<rustdoc[8f23bbef6cf7efb7]::clean::types::Item>, <rustdoc[8f23bbef6cf7efb7]::formats::cache::CacheBuilder as rustdoc[8f23bbef6cf7efb7]::fold::DocFolder>::fold_inner_recur::{closure#6}>>>::from_iter
  25:     0x55609f7c4b15 - <rustdoc[8f23bbef6cf7efb7]::formats::cache::CacheBuilder as rustdoc[8f23bbef6cf7efb7]::fold::DocFolder>::fold_inner_recur
  26:     0x55609f7c4f3f - <rustdoc[8f23bbef6cf7efb7]::formats::cache::CacheBuilder as rustdoc[8f23bbef6cf7efb7]::fold::DocFolder>::fold_item_recur
  27:     0x55609f7c8a72 - <rustdoc[8f23bbef6cf7efb7]::formats::cache::CacheBuilder as rustdoc[8f23bbef6cf7efb7]::fold::DocFolder>::fold_item
  28:     0x55609f7c61b1 - <rustdoc[8f23bbef6cf7efb7]::formats::cache::Cache>::populate
  29:     0x55609f67bbc9 - <rustc_session[484a5cd1f43b0798]::session::Session>::time::<rustdoc[8f23bbef6cf7efb7]::clean::types::Crate, rustdoc[8f23bbef6cf7efb7]::core::run_global_ctxt::{closure#9}>
  30:     0x55609f70ba7c - rustdoc[8f23bbef6cf7efb7]::core::run_global_ctxt
  31:     0x55609f67cca4 - <rustc_interface[e3f740b58bbe8d54]::passes::QueryContext>::enter::<rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}::{closure#0}::{closure#1}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>
  32:     0x55609f4ce78a - <rustc_interface[e3f740b58bbe8d54]::interface::Compiler>::enter::<rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>
  33:     0x55609f61486a - rustc_span[414a16377e6cb62b]::with_source_map::<core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>, rustc_interface[e3f740b58bbe8d54]::interface::run_compiler<core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>, rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  34:     0x55609f499695 - <scoped_tls[b199c6e77ce176e9]::ScopedKey<rustc_span[414a16377e6cb62b]::SessionGlobals>>::set::<rustc_interface[e3f740b58bbe8d54]::interface::run_compiler<core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>, rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}>::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>
  35:     0x55609f6270b0 - std[f1a6b9449c89a13c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e3f740b58bbe8d54]::util::run_in_thread_pool_with_globals<rustc_interface[e3f740b58bbe8d54]::interface::run_compiler<core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>, rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}>::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>
  36:     0x55609f7819df - <<std[f1a6b9449c89a13c]::thread::Builder>::spawn_unchecked_<rustc_interface[e3f740b58bbe8d54]::util::run_in_thread_pool_with_globals<rustc_interface[e3f740b58bbe8d54]::interface::run_compiler<core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>, rustdoc[8f23bbef6cf7efb7]::main_args::{closure#1}>::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[468623a6da7d9ec9]::result::Result<(), rustc_errors[78faa046e0c9ca7a]::ErrorGuaranteed>>::{closure#1} as core[468623a6da7d9ec9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f8aae086c53 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h633e4f7ed41b131b
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/alloc/src/boxed.rs:2000:9
  38:     0x7f8aae086c53 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h46d52a363ffe776a
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/alloc/src/boxed.rs:2000:9
  39:     0x7f8aae086c53 - std::sys::unix::thread::Thread::new::thread_start::h6d9ed7daf86174ef
                               at /rustc/92c1937a90e5b6f20fa6e87016d6869da363972e/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7f8aa9a7f8fd - <unknown>
  41:     0x7f8aa9b01a60 - <unknown>
  42:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.68.0-nightly (92c1937a9 2022-12-27) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    C-bugCategory: This is a bug.
    on Dec 28, 2022
  2. chenyukang commented on Dec 29, 2022

    @chenyukang
    Member

    @rustbot claim

  3. added a commit that references this issue on Dec 29, 2022
    caa33bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions