Skip to content

rust-1.75.0 fails to compile with ICE on aarch64 and various ppc arches with LTO enabled - error: could not compile memchr #121124

Open
@bowlofeggs

Description

@bowlofeggs

Greetings! A Gentoo user reported a build failure with Rust 1.75.0 on aarch64 when building with lto = "fat" in config.toml. Other users have found that LTO also causes build failures on ppc, ppc64, and ppc64le.

Meta

This is Rust 1.75.0, built on the end users' machines.

Error output

Caused by:
  process didn't exit successfully: `CARGO=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rust-stage0/bin/cargo CARGO_CRATE_NAME=pkg_config CARGO_MANIFEST_DIR=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/pkg-config CARGO_PKG_AUTHORS='Alex Crichton <[alex@alexcrichton.com](mailto:alex@alexcrichton.com)>' CARGO_PKG_DESCRIPTION='A library to run the pkg-config system tool at build time in order to be used in
  Cargo build scripts.
  ' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=pkg-config CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/pkg-config-rs' CARGO_PKG_RUST_VERSION=1.30 CARGO_PKG_VERSION=0.3.27 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=3 CARGO_PKG_VERSION_PATCH=27 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps:/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2/lib' /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/bootstrap/debug/rustc --crate-name pkg_config /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/pkg-config/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off -Zunstable-options --check-cfg 'values(feature)' --check-cfg 'names()' --check-cfg 'values()' -C metadata=13f5ba3fd8dd7c11 -C extra-filename=-13f5ba3fd8dd7c11 --out-dir /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps -C linker=aarch64-unknown-linux-gnu-gcc -L dependency=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps --cap-lints warn -Z binary-dep-depinfo` (exit status: 101)
thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:633:57:
index out of bounds: the len is 1 but the index is 4294967040
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval::interpret::place::PlaceTy>
   4: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::eval_rvalue_into_place
   5: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
   6: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
   7: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
   8: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
   9: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  10: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  11: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  12: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  13: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
  14: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  15: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  16: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
  17: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  18: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  19: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  20: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  21: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
  22: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  23: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  24: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
  25: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  26: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  27: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  28: <rustc_middle::mir::consts::Const>::try_eval_scalar_int
  29: <rustc_middle::mir::consts::Const>::try_eval_bits
  30: <rustc_const_eval::transform::promote_consts::Validator>::validate_local
  31: <core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_const_eval::transform::promote_consts::Candidate>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find::check<rustc_const_eval::transform::promote_consts::Candidate, &mut rustc_const_eval::transform::promote_consts::validate_candidates::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_const_eval::transform::promote_consts::Candidate>>
  32: <alloc::vec::Vec<rustc_const_eval::transform::promote_consts::Candidate> as alloc::vec::spec_from_iter::SpecFromIter<rustc_const_eval::transform::promote_consts::Candidate, core::iter::adapters::filter::Filter<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_const_eval::transform::promote_consts::Candidate>>, rustc_const_eval::transform::promote_consts::validate_candidates::{closure#0}>>>::from_iter
  33: <rustc_const_eval::transform::promote_consts::PromoteTemps as rustc_middle::mir::MirPass>::run_pass
  34: rustc_mir_transform::pass_manager::run_passes_inner
  35: rustc_mir_transform::mir_promoted
      [... omitted 1 frame ...]
  36: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  37: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  38: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  39: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
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 attach the file at `/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/memchr/rustc-ice-2024-02-11T16_22_27-21317.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -Z unstable-options -C linker=aarch64-unknown-linux-gnu-gcc -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -Z binary-dep-depinfo -Z tls-model=initial-exec

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

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::MAX`
#1 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::MAX`  |  = note: this failure-note originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

#2 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::BITS`
#3 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::BITS`
#4 [eval_to_allocation_raw] const-evaluating + checking `arch::all::memchr::USIZE_BYTES`
#5 [eval_to_const_value_raw] simplifying constant for the type system `arch::all::memchr::USIZE_BYTES`
#6 [mir_promoted] promoting constants in MIR for `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#7 [mir_borrowck] borrow-checking `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#8 [analysis] running analysis passes on this crate
end of query stack

Did not run successfully: exit status: 101
Backtrace

This is the ice file that the output requested:

thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:633:57:
index out of bounds: the len is 1 but the index is 4294967040
stack backtrace:
   0:     0x400006ff8bc0 - std::backtrace::Backtrace::create::hb2aee29319b06e8e
   1:     0x400001a11a50 - <alloc[90ae2a520ce139ee]::boxed::Box<rustc_driver_impl[c9c7a953b4411394]::install_ice_hook::{closure#0}> as core[5a6fd8bb0fda964d]::ops::function::Fn<(&dyn for<'a, 'b> core[5a6fd8bb0fda964d]::ops::function::Fn<(&'a core[5a6fd8bb0fda964d]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[5a6fd8bb0fda964d]::marker::Send + core[5a6fd8bb0fda964d]::marker::Sync, &core[5a6fd8bb0fda964d]::panic::panic_info::PanicInfo)>>::call
   2:     0x400007011a54 - std::panicking::rust_panic_with_hook::h9c163f1d9c1cbb36
   3:     0x4000070117cc - std::panicking::begin_panic_handler::{{closure}}::h6b0448d5499b219f
   4:     0x40000700ef80 - std::sys_common::backtrace::__rust_end_short_backtrace::hbd2c6bb647b1e398
   5:     0x400007011558 - rust_begin_unwind
   6:     0x400006fdce38 - core::panicking::panic_fmt::h4078202a72ed11d6
   7:     0x400006fdcfc4 - core::panicking::panic_bounds_check::hbc8259532743cd37
   8:     0x4000018c93fc - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval[f31644989ab683b2]::interpret::place::PlaceTy>
   9:     0x4000018ec07c - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::eval_rvalue_into_place
  10:     0x400001993bb4 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  11:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  12:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  13:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  14:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  15:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  16:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  17:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  18:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  19:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  20:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  21:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  22:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  23:     0x400002288a60 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  24:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  25:     0x4000018d0cd4 - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  26:     0x400001993950 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  27:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  28:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  29:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  30:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  31:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  32:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  33:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  34:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  35:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  36:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  37:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  38:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  39:     0x400002288a60 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  40:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  41:     0x4000018d0cd4 - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  42:     0x400001993950 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  43:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  44:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  45:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  46:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  47:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  48:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  49:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  50:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  51:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  52:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  53:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  54:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  55:     0x400002288b30 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  56:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  57:     0x400001986b6c - <rustc_middle[808545804f58c292]::mir::consts::Const>::try_eval_scalar_int
  58:     0x400001986778 - <rustc_middle[808545804f58c292]::mir::consts::Const>::try_eval_bits
  59:     0x400001985780 - <rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Validator>::validate_local
  60:     0x400001908388 - <core[5a6fd8bb0fda964d]::iter::adapters::copied::Copied<core[5a6fd8bb0fda964d]::slice::iter::Iter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>> as core[5a6fd8bb0fda964d]::iter::traits::iterator::Iterator>::try_fold::<(), core[5a6fd8bb0fda964d]::iter::traits::iterator::Iterator::find::check<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate, &mut rustc_const_eval[f31644989ab683b2]::transform::promote_consts::validate_candidates::{closure#0}>::{closure#0}, core[5a6fd8bb0fda964d]::ops::control_flow::ControlFlow<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>>
  61:     0x4000019034ac - <alloc[90ae2a520ce139ee]::vec::Vec<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate> as alloc[90ae2a520ce139ee]::vec::spec_from_iter::SpecFromIter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate, core[5a6fd8bb0fda964d]::iter::adapters::filter::Filter<core[5a6fd8bb0fda964d]::iter::adapters::copied::Copied<core[5a6fd8bb0fda964d]::slice::iter::Iter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>>, rustc_const_eval[f31644989ab683b2]::transform::promote_consts::validate_candidates::{closure#0}>>>::from_iter
  62:     0x40000198b328 - <rustc_const_eval[f31644989ab683b2]::transform::promote_consts::PromoteTemps as rustc_middle[808545804f58c292]::mir::MirPass>::run_pass
  63:     0x400002621438 - rustc_mir_transform[5e8ad041f5dad077]::pass_manager::run_passes_inner
  64:     0x40000262ec74 - rustc_mir_transform[5e8ad041f5dad077]::mir_promoted
  65:     0x40000293d014 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 16usize]>>
  66:     0x40000291dfd8 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::VecCache<rustc_span[41bcdfd57efa771a]::def_id::LocalDefId, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  67:     0x40000299e398 - rustc_query_impl[7d02d90d958f3807]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  68:     0x40000149c1c4 - rustc_borrowck[710e2f5ce73b6fd1]::mir_borrowck
  69:     0x40000293cfc4 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 8usize]>>
  70:     0x40000291f578 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::VecCache<rustc_span[41bcdfd57efa771a]::def_id::LocalDefId, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  71:     0x4000029af354 - rustc_query_impl[7d02d90d958f3807]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  72:     0x400002005cdc - rustc_interface[db4590941cd866b]::passes::analysis
  73:     0x400002940df8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 1usize]>>
  74:     0x40000290d120 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::SingleCache<rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  75:     0x400002997c94 - rustc_query_impl[7d02d90d958f3807]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  76:     0x4000019e6bd4 - <rustc_interface[db4590941cd866b]::queries::QueryResult<&rustc_middle[808545804f58c292]::ty::context::GlobalCtxt>>::enter::<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  77:     0x400001a055ec - <scoped_tls[bc883fe07799d80a]::ScopedKey<rustc_span[41bcdfd57efa771a]::SessionGlobals>>::set::<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>
  78:     0x400001a09058 - std[bf926301822f3e32]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[db4590941cd866b]::util::run_in_thread_with_globals<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>
  79:     0x400001a02f70 - <<std[bf926301822f3e32]::thread::Builder>::spawn_unchecked_<rustc_interface[db4590941cd866b]::util::run_in_thread_with_globals<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#1} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  80:     0x40000701acd0 - std::sys::unix::thread::Thread::new::thread_start::h13adca5242298a37
  81:     0x400007152cbc - <unknown>
  82:     0x4000071bb2dc - <unknown>
  83:                0x0 - <unknown>


rustc version: 1.75.0 (82e1608df 2023-12-21) (gentoo)
platform: aarch64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::MAX`
#1 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::MAX`
#2 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::BITS`
#3 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::BITS`
#4 [eval_to_allocation_raw] const-evaluating + checking `arch::all::memchr::USIZE_BYTES`
#5 [eval_to_const_value_raw] simplifying constant for the type system `arch::all::memchr::USIZE_BYTES`
#6 [mir_promoted] promoting constants in MIR for `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#7 [mir_borrowck] borrow-checking `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#8 [analysis] running analysis passes on this crate
end of query stack

Users have found disabling lto in the build config.toml allows them to build Rust successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)C-bugCategory: This is a bug.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusE-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-AArch64Armv8-A or later processors in AArch64 modeO-PowerPCTarget: PowerPC processorsP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions