Skip to content
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

"index out of bounds: the len is 1 buit the index is 2" when compiling time on docs.rs #99289

Closed
V0ldek opened this issue Jul 15, 2022 · 2 comments · Fixed by #99263
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@V0ldek
Copy link
Contributor

V0ldek commented Jul 15, 2022

Description

It's hard for me to provide a MRE, since I can't reproduce the error locally or on GitHub pipelines.

The compilation of docs of my crate fails on docs.rs with an internal compiler error when compiling the time crate (v0.3.9).

I've created an issue at docs.rs repo and asked for a rebuild, but it failed with the same error.

My docs pipeline succeeds on newest nightly, it also works when I run docs locally on Ubuntu 22 (x86_64-unknown-linux-gnu).

Error output

See the two builds on docs.rs: https://docs.rs/crate/rsonpath/0.1.0/builds/593904, https://docs.rs/crate/rsonpath/0.1.0/builds/593800

Backtrace

[INFO] [stderr] thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 2', compiler/rustc_builtin_macros/src/format.rs:1001:28
[INFO] [stderr] stack backtrace:
[INFO] [stderr]    0:     0x7fa546788950 - std::backtrace_rs::backtrace::libunwind::trace::heeafe1f1ea6b4c2f
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
[INFO] [stderr]    1:     0x7fa546788950 - std::backtrace_rs::backtrace::trace_unsynchronized::hf08684e78cd6c167
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
[INFO] [stderr]    2:     0x7fa546788950 - std::sys_common::backtrace::_print_fmt::had9e99c2c8763a1e
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:66:5
[INFO] [stderr]    3:     0x7fa546788950 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b4c432d2a1e6303
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:45:22
[INFO] [stderr]    4:     0x7fa5467e1f2c - core::fmt::write::h87085de871a99231
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/fmt/mod.rs:1198:17
[INFO] [stderr]    5:     0x7fa54677a015 - std::io::Write::write_fmt::h7635d2f423aa55dc
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/io/mod.rs:1672:15
[INFO] [stderr]    6:     0x7fa54678b5e1 - std::sys_common::backtrace::_print::hc003bc1c22b7967b
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:48:5
[INFO] [stderr]    7:     0x7fa54678b5e1 - std::sys_common::backtrace::print::h1baa1ab7758e52b0
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:35:9
[INFO] [stderr]    8:     0x7fa54678b5e1 - std::panicking::default_hook::{{closure}}::he2f5e84c6ab77817
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:295:22
[INFO] [stderr]    9:     0x7fa54678b2b3 - std::panicking::default_hook::h3f96069db270c68f
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:314:9
[INFO] [stderr]   10:     0x7fa546fb2de4 - rustc_driver[1ce26eb46f30f4d]::DEFAULT_HOOK::{closure#0}::{closure#0}
[INFO] [stderr]   11:     0x7fa54678bdb6 - std::panicking::rust_panic_with_hook::hed0c1597bbc695a6
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:702:17
[INFO] [stderr]   12:     0x7fa54678bc07 - std::panicking::begin_panic_handler::{{closure}}::h0fc9e6b3154da131
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:588:13
[INFO] [stderr]   13:     0x7fa546788e34 - std::sys_common::backtrace::__rust_end_short_backtrace::hb9c2240a67931ff9
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys_common/backtrace.rs:138:18
[INFO] [stderr]   14:     0x7fa54678b932 - rust_begin_unwind
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/panicking.rs:584:5
[INFO] [stderr]   15:     0x7fa54674fc33 - core::panicking::panic_fmt::h6bda1b0556b509cd
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/panicking.rs:142:14
[INFO] [stderr]   16:     0x7fa54674fb72 - core::panicking::panic_bounds_check::hf8fc252dfbb36006
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/core/src/panicking.rs:84:5
[INFO] [stderr]   17:     0x7fa5493ed643 - rustc_builtin_macros[6a564b3b10d3c327]::format::expand_preparsed_format_args
[INFO] [stderr]   18:     0x7fa5493e6dac - rustc_builtin_macros[6a564b3b10d3c327]::format::expand_format_args_impl
[INFO] [stderr]   19:     0x7fa548d25bed - <rustc_expand[ec7f7165620ca96d]::expand::MacroExpander>::fully_expand_fragment
[INFO] [stderr]   20:     0x7fa54989a94b - <rustc_expand[ec7f7165620ca96d]::expand::MacroExpander>::expand_crate
[INFO] [stderr]   21:     0x7fa5491bfaa2 - <rustc_session[4ac326324d613686]::session::Session>::time::<core[32c218dbf3427c26]::result::Result<rustc_ast[f9ddef6e3c579104]::ast::Crate, rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_interface[694c7ab70a1d38bc]::passes::configure_and_expand::{closure#1}>
[INFO] [stderr]   22:     0x7fa5491a9832 - rustc_interface[694c7ab70a1d38bc]::passes::configure_and_expand
[INFO] [stderr]   23:     0x7fa5491b62c1 - <rustc_interface[694c7ab70a1d38bc]::queries::Queries>::expansion
[INFO] [stderr]   24:     0x7fa549174fcc - <rustc_interface[694c7ab70a1d38bc]::interface::Compiler>::enter::<rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}::{closure#2}, core[32c218dbf3427c26]::result::Result<core[32c218dbf3427c26]::option::Option<rustc_interface[694c7ab70a1d38bc]::queries::Linker>, rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
[INFO] [stderr]   25:     0x7fa5491711ff - rustc_span[717885ec7c6cd182]::with_source_map::<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_interface[694c7ab70a1d38bc]::interface::create_compiler_and_run<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#1}>
[INFO] [stderr]   26:     0x7fa54918d4b0 - rustc_interface[694c7ab70a1d38bc]::interface::create_compiler_and_run::<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>
[INFO] [stderr]   27:     0x7fa5491a15b2 - <scoped_tls[f235d80db834c386]::ScopedKey<rustc_span[717885ec7c6cd182]::SessionGlobals>>::set::<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
[INFO] [stderr]   28:     0x7fa54917378f - std[167b23ae759531ff]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[694c7ab70a1d38bc]::util::run_in_thread_pool_with_globals<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>
[INFO] [stderr]   29:     0x7fa54918d909 - <<std[167b23ae759531ff]::thread::Builder>::spawn_unchecked_<rustc_interface[694c7ab70a1d38bc]::util::run_in_thread_pool_with_globals<rustc_interface[694c7ab70a1d38bc]::interface::run_compiler<core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>, rustc_driver[1ce26eb46f30f4d]::run_compiler::{closure#1}>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#0}, core[32c218dbf3427c26]::result::Result<(), rustc_errors[3b3e5bcd1e9c2834]::ErrorGuaranteed>>::{closure#1} as core[32c218dbf3427c26]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stderr]   30:     0x7fa546795803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h86b1834fb0da834b
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/alloc/src/boxed.rs:1934:9
[INFO] [stderr]   31:     0x7fa546795803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h124d05192aaf60e0
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/alloc/src/boxed.rs:1934:9
[INFO] [stderr]   32:     0x7fa546795803 - std::sys::unix::thread::Thread::new::thread_start::h01e8d05fb6e030ea
[INFO] [stderr]                                at /rustc/c2f428d2f3340a0e7d995f4726223db91b93704c/library/std/src/sys/unix/thread.rs:108:17
[INFO] [stderr]   33:     0x7fa546693609 - start_thread
[INFO] [stderr]   34:     0x7fa5465b6133 - clone
[INFO] [stderr]   35:                0x0 - <unknown>
[INFO] [stderr] 
[INFO] [stderr] error: internal compiler error: unexpected panic
[INFO] [stderr] 
[INFO] [stderr] note: the compiler unexpectedly panicked. this is a bug.
[INFO] [stderr] 
[INFO] [stderr] 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
[INFO] [stderr] 
[INFO] [stderr] note: rustc 1.64.0-nightly (c2f428d2f 2022-07-14) running on x86_64-unknown-linux-gnu
[INFO] [stderr] 
[INFO] [stderr] note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
[INFO] [stderr] 
[INFO] [stderr] note: some of the compiler flags provided by cargo are hidden
[INFO] [stderr] 
[INFO] [stderr] query stack during panic:
[INFO] [stderr] end of query stack
[INFO] [stderr] error: could not compile `time`

@V0ldek V0ldek added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 15, 2022
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 15, 2022
@jyn514
Copy link
Member

jyn514 commented Jul 15, 2022

You have --cfg docsrs set in docs.rs, try setting that locally.

@compiler-errors
Copy link
Member

This is a dupe of #99261

@compiler-errors compiler-errors changed the title index out of bounds: the len is 1 buit the index is 2" when compiling time` on docs.rs "index out of bounds: the len is 1 buit the index is 2" when compiling time on docs.rs Jul 15, 2022
@bors bors closed this as completed in 5635158 Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants