Skip to content

Out of bounds in link.rs:2700 when compiling proc_macro #126014

Closed as not planned
Closed as not planned
@elfenpiff

Description

@elfenpiff

Code

extern crate proc_macro;
use proc_macro::TokenStream;
use quote::quote;

#[proc_macro_derive(PlacementDefault)]
pub fn placement_default_derive(input: TokenStream) -> TokenStream {
  let expanded = quote! {};
  TokenStream::from(expanded)
}

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (a330e4959 2024-06-04)
binary: rustc
commit-hash: a330e49593ee890f9197727a3a558b6e6b37f843
commit-date: 2024-06-04
host: x86_64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.6

Error output

   Compiling clap_derive v4.5.4
   Compiling generic-tests v0.1.2
   Compiling pin-init-internal v0.2.0
thread 'rustc' panicked at compiler/rustc_codegen_ssa/src/back/link.rs:2700:27:
index out of bounds: the len is 24 but the index is 24
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: rustc_codegen_ssa::back::link::linker_with_args
   4: rustc_codegen_ssa::back::link::link_natively
   5: rustc_codegen_ssa::back::link::link_binary
   6: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::link
   7: <rustc_interface::queries::Linker>::link
   8: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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: please make sure that you have updated to the latest nightly

note: please attach the file at `/Users/elchris/Development/iceoryx2/rustc-ice-2024-06-05T07_26_21-609.txt` to your bug report

note: compiler flags: --crate-type proc-macro -C prefer-dynamic -C embed-bitcode=no -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
error: could not compile `iceoryx2-bb-derive-macros` (lib)
warning: build failed, waiting for other jobs to finish...
error: command `/Users/elchris/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo test --no-run --message-format json-render-diagnostics --workspace` exited with code 101
Backtrace

thread 'rustc' panicked at compiler/rustc_codegen_ssa/src/back/link.rs:2700:27:
index out of bounds: the len is 24 but the index is 24
stack backtrace:
   0:        0x101f0f907 - std::backtrace::Backtrace::create::h5ec31ed1a6a79ce3
   1:        0x101f0f855 - std::backtrace::Backtrace::force_capture::h017c00487596bf6c
   2:        0x103853eef - std[fd47c059b2fa4777]::panicking::update_hook::<alloc[565546fc32cb09a3]::boxed::Box<rustc_driver_impl[f6083e59583e4f45]::install_ice_hook::{closure#0}>>::{closure#0}
   3:        0x101f29a03 - std::panicking::rust_panic_with_hook::h3943d4be00557b54
   4:        0x101f29342 - std::panicking::begin_panic_handler::{{closure}}::h838ae83fe97278e5
   5:        0x101f26809 - std::sys_common::backtrace::__rust_end_short_backtrace::h4975a2d78b039313
   6:        0x101f29076 - _rust_begin_unwind
   7:        0x101f8f662 - core::panicking::panic_fmt::he2a50c35b6323641
   8:        0x101f8f896 - core::panicking::panic_bounds_check::h20fff5e1a4815a51
   9:        0x10368ad78 - rustc_codegen_ssa[e22a8028cc75994c]::back::link::linker_with_args
  10:        0x10367cf2a - rustc_codegen_ssa[e22a8028cc75994c]::back::link::link_natively
  11:        0x103676591 - rustc_codegen_ssa[e22a8028cc75994c]::back::link::link_binary
  12:        0x1035cc9c4 - <rustc_codegen_llvm[7134ee66eddd3d30]::LlvmCodegenBackend as rustc_codegen_ssa[e22a8028cc75994c]::traits::backend::CodegenBackend>::link
  13:        0x10404b1ba - <rustc_interface[13b0004f64ddc7cd]::queries::Linker>::link
  14:        0x1038523ea - rustc_interface[13b0004f64ddc7cd]::interface::run_compiler::<core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>, rustc_driver_impl[f6083e59583e4f45]::run_compiler::{closure#0}>::{closure#1}
  15:        0x103849011 - std[fd47c059b2fa4777]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[13b0004f64ddc7cd]::util::run_in_thread_with_globals<rustc_interface[13b0004f64ddc7cd]::util::run_in_thread_pool_with_globals<rustc_interface[13b0004f64ddc7cd]::interface::run_compiler<core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>, rustc_driver_impl[f6083e59583e4f45]::run_compiler::{closure#0}>::{closure#1}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>::{closure#0}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>
  16:        0x10385d306 - <<std[fd47c059b2fa4777]::thread::Builder>::spawn_unchecked_<rustc_interface[13b0004f64ddc7cd]::util::run_in_thread_with_globals<rustc_interface[13b0004f64ddc7cd]::util::run_in_thread_pool_with_globals<rustc_interface[13b0004f64ddc7cd]::interface::run_compiler<core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>, rustc_driver_impl[f6083e59583e4f45]::run_compiler::{closure#0}>::{closure#1}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>::{closure#0}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[9f49ac83bf5f531c]::result::Result<(), rustc_span[2b14f912dbebe68b]::ErrorGuaranteed>>::{closure#2} as core[9f49ac83bf5f531c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  17:        0x101f3322b - std::sys::pal::unix::thread::Thread::new::thread_start::h38fb25f81c8126f3
  18:     0x7fff2032f950 - __pthread_start


rustc version: 1.80.0-nightly (a330e4959 2024-06-04)
platform: x86_64-apple-darwin

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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