Skip to content

ICE when using Instant type with the time crate. #125484

Closed
@bend-n

Description

@bend-n

Code

type hi_rustc_devs_you_are_the_best = std::time::Instant;
fn main() {}
[dependencies]
time = { version = "=0.3.36", default-features = false }
rustc 1.80.0-nightly (867900499 2024-05-23)
binary: rustc
commit-hash: 8679004993f08807289911d9f400f4ac4391d2bc
commit-date: 2024-05-23
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

make sure to use cargo {build, run, test}.

Error output

thread 'rustc' panicked at compiler/rustc_codegen_ssa/src/back/link.rs:2700:27:
index out of bounds: the len is 19 but the index is 19
Backtrace

thread 'rustc' panicked at compiler/rustc_codegen_ssa/src/back/link.rs:2700:27:
index out of bounds: the len is 19 but the index is 19
stack backtrace:
   0:     0x7f4c72d14bd5 - std::backtrace_rs::backtrace::libunwind::trace::hc81ddd892f37780a
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f4c72d14bd5 - std::backtrace_rs::backtrace::trace_unsynchronized::h25113f8f3907d8be
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f4c72d14bd5 - std::backtrace::Backtrace::create::h4f3748e24e2503eb
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/backtrace.rs:331:13
   3:     0x7f4c72d14b25 - std::backtrace::Backtrace::force_capture::he79a6af8ebf22849
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/backtrace.rs:312:9
   4:     0x7f4c6f713446 - std[c84386057951cdf1]::panicking::update_hook::<alloc[4592256d7c6fc8c3]::boxed::Box<rustc_driver_impl[c7973d17cf87f5de]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f4c72d2f95b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h44aa27eef4dccdcb
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/alloc/src/boxed.rs:2077:9
   6:     0x7f4c72d2f95b - std::panicking::rust_panic_with_hook::h1aa3c5553cd412a6
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/panicking.rs:799:13
   7:     0x7f4c72d2f6d4 - std::panicking::begin_panic_handler::{{closure}}::ha60e6e6c3ca02408
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/panicking.rs:664:13
   8:     0x7f4c72d2cee9 - std::sys_common::backtrace::__rust_end_short_backtrace::he47d033b604f34e1
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/sys_common/backtrace.rs:171:18
   9:     0x7f4c72d2f407 - rust_begin_unwind
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/panicking.rs:652:5
  10:     0x7f4c72d780c3 - core::panicking::panic_fmt::he0b49d9fe944afab
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/core/src/panicking.rs:72:14
  11:     0x7f4c72d782e7 - core::panicking::panic_bounds_check::h4aab5c6abdb84502
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/core/src/panicking.rs:274:5
  12:     0x7f4c7182f58e - rustc_codegen_ssa[de9b47d4234be54f]::back::link::linker_with_args
  13:     0x7f4c71824b1e - rustc_codegen_ssa[de9b47d4234be54f]::back::link::link_natively
  14:     0x7f4c71754a0f - rustc_codegen_ssa[de9b47d4234be54f]::back::link::link_binary
  15:     0x7f4c71753f22 - <rustc_codegen_llvm[63b5484f8e8a1abd]::LlvmCodegenBackend as rustc_codegen_ssa[de9b47d4234be54f]::traits::backend::CodegenBackend>::link
  16:     0x7f4c7175737a - <rustc_interface[1555bb895ed40208]::queries::Linker>::link
  17:     0x7f4c715b8aa9 - rustc_interface[1555bb895ed40208]::interface::run_compiler::<core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>, rustc_driver_impl[c7973d17cf87f5de]::run_compiler::{closure#0}>::{closure#1}
  18:     0x7f4c715a3f67 - std[c84386057951cdf1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1555bb895ed40208]::util::run_in_thread_with_globals<rustc_interface[1555bb895ed40208]::util::run_in_thread_pool_with_globals<rustc_interface[1555bb895ed40208]::interface::run_compiler<core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>, rustc_driver_impl[c7973d17cf87f5de]::run_compiler::{closure#0}>::{closure#1}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>::{closure#0}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>
  19:     0x7f4c715a3d2a - <<std[c84386057951cdf1]::thread::Builder>::spawn_unchecked_<rustc_interface[1555bb895ed40208]::util::run_in_thread_with_globals<rustc_interface[1555bb895ed40208]::util::run_in_thread_pool_with_globals<rustc_interface[1555bb895ed40208]::interface::run_compiler<core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>, rustc_driver_impl[c7973d17cf87f5de]::run_compiler::{closure#0}>::{closure#1}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>::{closure#0}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d780e6c6047fe0c9]::result::Result<(), rustc_span[7e054f7c4ab6d345]::ErrorGuaranteed>>::{closure#2} as core[d780e6c6047fe0c9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  20:     0x7f4c72d3973b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he7419603c6721fe9
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/alloc/src/boxed.rs:2063:9
  21:     0x7f4c72d3973b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdd889fbd56bc6c7f
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/alloc/src/boxed.rs:2063:9
  22:     0x7f4c72d3973b - std::sys::pal::unix::thread::Thread::new::thread_start::hc8faaa9672833890
                               at /rustc/8679004993f08807289911d9f400f4ac4391d2bc/library/std/src/sys/pal/unix/thread.rs:108:17
  23:     0x7f4c6c4a6ded - <unknown>
  24:     0x7f4c6c52a0dc - <unknown>
  25:                0x0 - <unknown>


rustc version: 1.80.0-nightly (867900499 2024-05-23)
platform: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler 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