Skip to content

could not compile time 'index out of bounds: the len is 1 but the index is 2' #99329

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
letto4135 opened this issue Jul 16, 2022 · 2 comments
Closed
Labels
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.

Comments

@letto4135
Copy link

letto4135 commented Jul 16, 2022

I've seen a few of these opened with a "update rust" solution, but as far as I know I am up to date.

Code

cargo install trunk

Error output

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
stack backtrace:
   0:        0x10b2d2ca4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4d86da9d3736a52d
   1:        0x10b32a68b - core::fmt::write::h4100c91e34b46860
   2:        0x10b2c545c - std::io::Write::write_fmt::hbebacfc28bcb7e63
   3:        0x10b2d5d77 - std::panicking::default_hook::{{closure}}::hd1401e79e66368b2
   4:        0x10b2d5a80 - std::panicking::default_hook::h0d3c0f46f3eb5b87
   5:        0x113a92e5a - rustc_driver[73f94c78c1d7d2d0]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x10b2d64ad - std::panicking::rust_panic_with_hook::h79b08049599e7781
   7:        0x10b2d6353 - std::panicking::begin_panic_handler::{{closure}}::h6759a4e79ddd7d62
   8:        0x10b2d3157 - std::sys_common::backtrace::__rust_end_short_backtrace::ha49d7b96ae0f3fdf
   9:        0x10b2d602d - _rust_begin_unwind
  10:        0x10b3559f3 - core::panicking::panic_fmt::hc9b2ac84f45a78f2
  11:        0x10b355946 - core::panicking::panic_bounds_check::hd73082592787ac04
  12:        0x11651e272 - rustc_builtin_macros[4c4cf493c0067ce6]::format::expand_preparsed_format_args
  13:        0x1165169db - rustc_builtin_macros[4c4cf493c0067ce6]::format::expand_format_args_impl
  14:        0x117a06e44 - <rustc_expand[219fa54abb38e138]::expand::MacroExpander>::fully_expand_fragment
  15:        0x117a0615f - <rustc_expand[219fa54abb38e138]::expand::MacroExpander>::expand_crate
  16:        0x113b538d6 - <rustc_session[6a4c6fef4db8af12]::session::Session>::time::<core[4765b6e14de13592]::result::Result<rustc_ast[941672277c0de11b]::ast::Crate, rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_interface[8a17d161f34c737e]::passes::configure_and_expand::{closure#1}>
  17:        0x113b4aa23 - <rustc_interface[8a17d161f34c737e]::passes::boxed_resolver::BoxedResolver>::access::<<rustc_interface[8a17d161f34c737e]::queries::Queries>::expansion::{closure#0}::{closure#0}, core[4765b6e14de13592]::result::Result<rustc_ast[941672277c0de11b]::ast::Crate, rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>
  18:        0x113b2c526 - <rustc_interface[8a17d161f34c737e]::queries::Queries>::expansion
  19:        0x113a0def1 - <rustc_interface[8a17d161f34c737e]::interface::Compiler>::enter::<rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}::{closure#2}, core[4765b6e14de13592]::result::Result<core[4765b6e14de13592]::option::Option<rustc_interface[8a17d161f34c737e]::queries::Linker>, rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>
  20:        0x113a037f8 - rustc_span[b3c07a240d8aa70d]::with_source_map::<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_interface[8a17d161f34c737e]::interface::create_compiler_and_run<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}>::{closure#1}>
  21:        0x113a2dcf6 - rustc_interface[8a17d161f34c737e]::interface::create_compiler_and_run::<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}>
  22:        0x113a00825 - <scoped_tls[bbf5cad6a1edfb51]::ScopedKey<rustc_span[b3c07a240d8aa70d]::SessionGlobals>>::set::<rustc_interface[8a17d161f34c737e]::interface::run_compiler<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}>::{closure#0}, core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>
  23:        0x113a0a469 - std[51cc303cb6d2584d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8a17d161f34c737e]::util::run_in_thread_pool_with_globals<rustc_interface[8a17d161f34c737e]::interface::run_compiler<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}>::{closure#0}, core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>::{closure#0}, core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>
  24:        0x113a2ea01 - <<std[51cc303cb6d2584d]::thread::Builder>::spawn_unchecked_<rustc_interface[8a17d161f34c737e]::util::run_in_thread_pool_with_globals<rustc_interface[8a17d161f34c737e]::interface::run_compiler<core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>, rustc_driver[73f94c78c1d7d2d0]::run_compiler::{closure#1}>::{closure#0}, core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>::{closure#0}, core[4765b6e14de13592]::result::Result<(), rustc_errors[6b560b2f72f0dc1a]::ErrorGuaranteed>>::{closure#1} as core[4765b6e14de13592]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:        0x10b2df187 - std::sys::unix::thread::Thread::new::thread_start::hae41e3c2653ceb35
  26:     0x7ff80af594e1 - __pthread_start

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.64.0-nightly (23e21bdd2 2022-07-15) running on x86_64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `time`
warning: build failed, waiting for other jobs to finish...
error: failed to compile `trunk v0.16.0`, intermediate artifacts can be found at `/var/folders/1_/fjzflw_n6qv4n4tjv0dyb6hw0000gn/T/cargo-installLzUIFc`

version

rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.64.0-nightly (23e21bdd2 2022-07-15)`

computer

M1 Mac Monterey 12.4

Edit:

Compiles fine on stable, broken on nightly.

@letto4135 letto4135 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 16, 2022
@Noratrieb
Copy link
Member

Duplicate of #99261

@letto4135
Copy link
Author

I even looked at that one, for some reason I thought it was closed.. >_>
My bad, thanks @Nilstrieb

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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants