Skip to content

Make TypeId const comparable #142789

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 20, 2025

This should unblock stabilizing const TypeId::of and allow us to progress into any possible future we want to take TypeId to.

To achieve that TypeId now contains 16 / size_of<usize>() pointers which each are actually just size_of<usize>() bytes of the stable hash. At compile-time these pointers cannot be dereferenced or otherwise inspected (at present doing so might ICE the compiler). Preventing inspection of this data allows us to refactor TypeId to any other scheme in the future without breaking anyone who was tempted to transmute TypeId to obtain the hash at compile-time.

cc @eddyb for their previous work on #95845 (which we still can do in the future if we want to get rid of the hash as the final thing that declares two TypeIds as equal).

r? @RalfJung

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the constable-type-id branch from 3cddd21 to 1fd7b66 Compare June 21, 2025 10:20
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

It will be a while until I have the capacity to review a PR of this scale.

Meanwhile, could you say a bit more about the architecture of the change? It seems you want for the "new kind of allocation" approach, but it's not clear from the PR description how exactly that shows up in TypeId.

Also, I am definitely not comfortable landing this by myself, I can only review the const-eval parts. Changing the representation of TypeId has ramifications well beyond that that I do not feel qualified to evaluate -- I think an MCP would be justified.

@rustbot
Copy link
Collaborator

rustbot commented Jun 21, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 21, 2025

Well, I got private feedback yesterday that instead of encoding a 16 byte value as an 8 byte pointer to the 16 byte value and an 8 byte hash, I should just do the thing where we split up type id internally into pointer sized chunks and codegen will make a hash out of it again.

TLDR: no changes to runtime type id anymore in the latest revision of this PR. Only compile-time type id is now a bit funny

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 21, 2025

It will be a while until I have the capacity to review a PR of this scale.

I'm splitting unrelated parts out, so the high level feedback is already useful and I'll look for libs and codegen ppl to review the appropriate parts

@rust-log-analyzer

This comment has been minimized.

jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Jun 23, 2025
Make `PartialEq` a `const_trait`

r? `@fee1-dead` or `@compiler-errors`

something generally useful but also required for rust-lang#142789
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Jun 23, 2025
Make `PartialEq` a `const_trait`

r? ``@fee1-dead`` or ``@compiler-errors``

something generally useful but also required for rust-lang#142789
rust-timer added a commit that referenced this pull request Jun 23, 2025
Rollup merge of #142822 - oli-obk:const-partial-eq, r=fee1-dead

Make `PartialEq` a `const_trait`

r? ``@fee1-dead`` or ``@compiler-errors``

something generally useful but also required for #142789
@bors
Copy link
Collaborator

bors commented Jun 23, 2025

☔ The latest upstream changes (presumably #142906) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the constable-type-id branch 2 times, most recently from b8a7a10 to 1c47a64 Compare June 24, 2025 09:25
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the constable-type-id branch from 1c47a64 to bcb4aa2 Compare June 24, 2025 13:02
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the constable-type-id branch from bcb4aa2 to 693b930 Compare June 24, 2025 14:05
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
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 `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_26_58-20885.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <(dyn std::any::Any + 'static)>::downcast_ref(_1: &dyn std::any::Any) -> std::option::Option<&T> {
    debug self => _1;
    let mut _0: std::option::Option<&T>;
    let mut _2: bool;
    let _3: &T;
    scope 1 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
        debug self => _1;
        let _4: std::any::TypeId;
        let mut _6: &std::any::TypeId;
        let mut _7: &std::any::TypeId;
        scope 2 {
            debug t => _4;
            let _5: std::any::TypeId;
            scope 3 {
                debug concrete => _5;
                scope 5 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                    debug self => _6;
                    debug other => _7;
                    scope 6 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                        debug a => _6;
                        debug b => _7;
                        let mut _8: &[*const (); 2];
                        let mut _9: &[*const (); 2];
                        scope 7 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                            debug self => _8;
                            debug other => _9;
                            scope 8 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                debug a => _8;
                                debug b => _9;
                                scope 9 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _8;
                                    debug index => const std::ops::RangeFull;
                                    let _10: &[*const ()];
                                    scope 10 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _10;
                                        debug index => const std::ops::RangeFull;
                                        scope 11 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _10;
                                        }
                                    }
                                }
                                scope 12 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _9;
                                    debug index => const std::ops::RangeFull;
                                    let _11: &[*const ()];
                                    scope 13 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _11;
                                        debug index => const std::ops::RangeFull;
                                        scope 14 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _11;
                                        }
                                    }
                                }
                                scope 15 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                    debug self => _10;
                                    debug other => _11;
                                }
                            }
                        }
                    }
                }
            }
        }
        scope 4 (inlined std::any::TypeId::of::<T>) {
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_4);
        _4 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_5);
        _5 = <dyn std::any::Any as std::any::Any>::type_id(copy _1) -> [return: bb5, unwind continue];
    }

    bb1: {
        _3 = <(dyn std::any::Any + 'static)>::downcast_ref_unchecked::<T>(move _1) -> [return: bb2, unwind continue];
    }

    bb2: {
        _0 = std::option::Option::<&T>::Some(copy _3);
        goto -> bb4;
    }

    bb3: {
        _0 = const {transmute(0x0000000000000000): std::option::Option<&T>};
        goto -> bb4;
    }

    bb4: {
        StorageDead(_2);
        return;
---
        _6 = &_4;
        StorageLive(_7);
        _7 = &_5;
        StorageLive(_8);
        _8 = &(_4.0: [*const (); 2]);
        StorageLive(_9);
        _9 = &(_5.0: [*const (); 2]);
        StorageLive(_10);
        StorageLive(_11);
        _10 = copy _8 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _11 = copy _9 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _10, move _11) -> [return: bb6, unwind continue];
    }

    bb6: {
        StorageDead(_11);
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_7);
        StorageDead(_6);
        StorageDead(_5);
        StorageDead(_4);
        switchInt(move _2) -> [0: bb3, otherwise: bb1];
    }
}

[RUSTC-TIMING] allocbenches test:true 8.432
[RUSTC-TIMING] corebenches test:true 8.573
error: could not compile `coretests` (bench "corebenches")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustc-clif --crate-name corebenches --edition=2024 coretests/benches/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=8bf502b0b1f382a0 -C extra-filename=-20679e6ffff022f1 --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/debug/deps --extern coretests=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/libcoretests-d53c284ce10aa626.rlib --extern rand=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand-317f0949b407aee9.rlib --extern rand_xorshift=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand_xorshift-4cad3ad5e73d32bc.rlib -Csymbol-mangling-version=v0 -Zrandomize-layout -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off -Clink-arg=-L/usr/lib/llvm-19/lib -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages --cap-lints=allow --cfg randomized_layouts` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] alloctests test:true 13.816

thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/constant.rs:383:25:
internal error: entered unreachable code
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn std::rc::Rc::<(dyn std::any::Any + 'static), A>::downcast(_1: std::rc::Rc<dyn std::any::Any, A>) -> std::result::Result<std::rc::Rc<T, A>, std::rc::Rc<dyn std::any::Any, A>> {
    debug self => _1;
    let mut _0: std::result::Result<std::rc::Rc<T, A>, std::rc::Rc<dyn std::any::Any, A>>;
    let mut _2: bool;
    let _3: &dyn std::any::Any;
    let mut _4: &std::rc::Rc<dyn std::any::Any, A>;
    let mut _5: std::rc::Rc<dyn std::any::Any, A>;
    let mut _6: std::rc::Rc<T, A>;
    let mut _7: std::ptr::NonNull<std::rc::RcInner<T>>;
    let mut _8: std::rc::Rc<dyn std::any::Any, A>;
    scope 1 {
        debug ptr => _20;
        debug alloc => _22;
        scope 31 (inlined std::ptr::NonNull::<std::rc::RcInner<dyn std::any::Any>>::cast::<std::rc::RcInner<T>>) {
            debug self => _20;
            let mut _29: *const std::rc::RcInner<T>;
            let mut _30: *mut std::rc::RcInner<dyn std::any::Any>;
            scope 32 (inlined std::ptr::NonNull::<std::rc::RcInner<dyn std::any::Any>>::as_ptr) {
            }
        }
        scope 33 (inlined std::rc::Rc::<T, A>::from_inner_in) {
            debug ptr => _7;
            debug alloc => _22;
        }
    }
    scope 2 (inlined <std::rc::Rc<dyn std::any::Any, A> as std::ops::Deref>::deref) {
        debug self => _4;
        scope 3 (inlined std::rc::Rc::<dyn std::any::Any, A>::inner) {
            debug self => _4;
            scope 4 (inlined std::ptr::NonNull::<std::rc::RcInner<dyn std::any::Any>>::as_ref::<'_>) {
                let _9: *const std::rc::RcInner<dyn std::any::Any>;
                let mut _10: std::ptr::NonNull<std::rc::RcInner<dyn std::any::Any>>;
                scope 5 (inlined std::ptr::NonNull::<std::rc::RcInner<dyn std::any::Any>>::as_ptr) {
                }
                scope 6 (inlined std::ptr::mut_ptr::<impl *mut std::rc::RcInner<dyn std::any::Any>>::cast_const) {
                }
            }
        }
    }
    scope 7 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
        debug self => _3;
        let _11: std::any::TypeId;
        let mut _13: &std::any::TypeId;
        let mut _14: &std::any::TypeId;
        scope 8 {
            debug t => _11;
            let _12: std::any::TypeId;
            scope 9 {
                debug concrete => _12;
                scope 11 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                    debug self => _13;
                    debug other => _14;
                    scope 12 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                        debug a => _13;
                        debug b => _14;
                        let mut _15: &[*const (); 2];
                        let mut _16: &[*const (); 2];
                        scope 13 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                            debug self => _15;
                            debug other => _16;
                            scope 14 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                debug a => _15;
                                debug b => _16;
                                scope 15 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _15;
                                    debug index => const std::ops::RangeFull;
                                    let _17: &[*const ()];
                                    scope 16 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _17;
                                        debug index => const std::ops::RangeFull;
                                        scope 17 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _17;
                                        }
                                    }
                                }
                                scope 18 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _16;
                                    debug index => const std::ops::RangeFull;
                                    let _18: &[*const ()];
                                    scope 19 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _18;
                                        debug index => const std::ops::RangeFull;
                                        scope 20 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _18;
                                        }
                                    }
                                }
                                scope 21 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                    debug self => _17;
                                    debug other => _18;
                                }
                            }
                        }
                    }
                }
            }
        }
        scope 10 (inlined std::any::TypeId::of::<T>) {
        }
    }
    scope 22 (inlined std::rc::Rc::<dyn std::any::Any, A>::into_inner_with_allocator) {
        debug this => _5;
        let _19: std::mem::ManuallyDrop<std::rc::Rc<dyn std::any::Any, A>>;
        let mut _20: std::ptr::NonNull<std::rc::RcInner<dyn std::any::Any>>;
        let mut _21: &std::mem::ManuallyDrop<std::rc::Rc<dyn std::any::Any, A>>;
        let mut _22: A;
        let mut _23: *const A;
        let mut _24: &std::mem::ManuallyDrop<std::rc::Rc<dyn std::any::Any, A>>;
        scope 23 {
            debug this => _19;
            scope 25 (inlined <std::mem::ManuallyDrop<std::rc::Rc<dyn std::any::Any, A>> as std::ops::Deref>::deref) {
                debug self => _21;
            }
            scope 26 (inlined <std::mem::ManuallyDrop<std::rc::Rc<dyn std::any::Any, A>> as std::ops::Deref>::deref) {
                debug self => _24;
            }
            scope 27 (inlined #[track_caller] std::ptr::read::<A>) {
                debug src => _23;
                let _25: ();
                let mut _26: *const ();
                let mut _27: usize;
                scope 28 (inlined core::ub_checks::check_language_ub) {
                    let mut _28: bool;
                    scope 29 (inlined core::ub_checks::check_language_ub::runtime) {
                    }
                }
                scope 30 (inlined std::mem::align_of::<A>) {
                }
            }
        }
        scope 24 (inlined std::mem::ManuallyDrop::<std::rc::Rc<dyn std::any::Any, A>>::new) {
            debug value => _5;
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_4);
        _4 = &_1;
        StorageLive(_9);
        StorageLive(_10);
        _10 = copy (_1.0: std::ptr::NonNull<std::rc::RcInner<dyn std::any::Any>>);
        _9 = copy _10 as *const std::rc::RcInner<dyn std::any::Any> (Transmute);
        StorageDead(_10);
        _3 = &((*_9).2: dyn std::any::Any);
        StorageDead(_9);
        StorageDead(_4);
        StorageLive(_11);
        _11 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_12);
        _12 = <dyn std::any::Any as std::any::Any>::type_id(move _3) -> [return: bb6, unwind: bb5];
    }

    bb1: {
        StorageLive(_5);
        _5 = move _1;
        StorageLive(_19);
        _19 = std::mem::ManuallyDrop::<std::rc::Rc<dyn std::any::Any, A>> { value: copy _5 };
        StorageLive(_21);
        _21 = &_19;
        StorageDead(_21);
        _20 = copy ((_19.0: std::rc::Rc<dyn std::any::Any, A>).0: std::ptr::NonNull<std::rc::RcInner<dyn std::any::Any>>);
        StorageLive(_23);
        StorageLive(_24);
        _24 = &_19;
        StorageDead(_24);
        _23 = &raw const ((_19.0: std::rc::Rc<dyn std::any::Any, A>).2: A);
        StorageLive(_28);
        _28 = UbChecks();
        switchInt(copy _28) -> [0: bb10, otherwise: bb8];
    }

    bb2: {
        _8 = move _1;
        _0 = std::result::Result::<std::rc::Rc<T, A>, std::rc::Rc<dyn std::any::Any, A>>::Err(copy _8);
---
        StorageDead(_2);
        return;
    }

    bb4 (cleanup): {
        resume;
    }

    bb5 (cleanup): {
        drop(_1) -> [return: bb4, unwind terminate(cleanup)];
    }

    bb6: {
        StorageLive(_13);
        _13 = &_11;
        StorageLive(_14);
        _14 = &_12;
        StorageLive(_15);
        _15 = &(_11.0: [*const (); 2]);
        StorageLive(_16);
        _16 = &(_12.0: [*const (); 2]);
        StorageLive(_17);
        StorageLive(_18);
        _17 = copy _15 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _18 = copy _16 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _17, move _18) -> [return: bb7, unwind: bb5];
    }

    bb7: {
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_16);
        StorageDead(_15);
        StorageDead(_14);
        StorageDead(_13);
        StorageDead(_12);
        StorageDead(_11);
        switchInt(move _2) -> [0: bb2, otherwise: bb1];
    }

    bb8: {
        StorageLive(_26);
        _26 = copy _23 as *const () (PtrToPtr);
        StorageLive(_27);
        _27 = AlignOf(A);
        _25 = std::ptr::read::precondition_check(move _26, move _27, const <A as std::mem::SizedTypeProperties>::IS_ZST) -> [return: bb9, unwind unreachable];
    }

    bb9: {
        StorageDead(_27);
        StorageDead(_26);
        goto -> bb10;
    }

    bb10: {
        _22 = copy ((_19.0: std::rc::Rc<dyn std::any::Any, A>).2: A);
        StorageDead(_28);
        StorageDead(_23);
        StorageDead(_19);
        StorageDead(_5);
        StorageLive(_6);
        StorageLive(_7);
        StorageLive(_30);
        StorageLive(_29);
        _30 = copy _20 as *mut std::rc::RcInner<dyn std::any::Any> (Transmute);
        _29 = copy _30 as *const std::rc::RcInner<T> (PtrToPtr);
        _7 = std::ptr::NonNull::<std::rc::RcInner<T>> { pointer: move _29 };
        StorageDead(_29);
        StorageDead(_30);
        _6 = std::rc::Rc::<T, A> { ptr: copy _7, phantom: const ZeroSized: std::marker::PhantomData<std::rc::RcInner<T>>, alloc: copy _22 };
        StorageDead(_7);
        _0 = std::result::Result::<std::rc::Rc<T, A>, std::rc::Rc<dyn std::any::Any, A>>::Ok(move _6);
        StorageDead(_6);
        goto -> bb3;
    }
}

---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn std::sync::Arc::<(dyn std::any::Any + std::marker::Send + std::marker::Sync + 'static), A>::downcast(_1: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>) -> std::result::Result<std::sync::Arc<T, A>, std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>> {
    debug self => _1;
    let mut _0: std::result::Result<std::sync::Arc<T, A>, std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>;
    let mut _2: bool;
    let _3: &dyn std::any::Any + std::marker::Send + std::marker::Sync;
    let mut _4: &std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>;
    let mut _5: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>;
    let mut _6: std::sync::Arc<T, A>;
    let mut _7: std::ptr::NonNull<alloc::sync::ArcInner<T>>;
    let mut _8: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>;
    scope 1 {
        debug ptr => _21;
        debug alloc => _23;
        scope 32 (inlined std::ptr::NonNull::<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>::cast::<alloc::sync::ArcInner<T>>) {
            debug self => _21;
            let mut _30: *const alloc::sync::ArcInner<T>;
            let mut _31: *mut alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>;
            scope 33 (inlined std::ptr::NonNull::<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>::as_ptr) {
            }
        }
        scope 34 (inlined std::sync::Arc::<T, A>::from_inner_in) {
            debug ptr => _7;
            debug alloc => _23;
        }
    }
    scope 2 (inlined <std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A> as std::ops::Deref>::deref) {
        debug self => _4;
        scope 3 (inlined std::sync::Arc::<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>::inner) {
            debug self => _4;
            scope 4 (inlined std::ptr::NonNull::<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>::as_ref::<'_>) {
                let _9: *const alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>;
                let mut _10: std::ptr::NonNull<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>;
                scope 5 (inlined std::ptr::NonNull::<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>::as_ptr) {
                }
                scope 6 (inlined std::ptr::mut_ptr::<impl *mut alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>::cast_const) {
                }
            }
        }
    }
    scope 7 (inlined <(dyn std::any::Any + std::marker::Send + std::marker::Sync + 'static)>::is::<T>) {
        debug self => _3;
        let mut _11: &dyn std::any::Any;
        scope 8 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
            debug self => _11;
            let _12: std::any::TypeId;
            let mut _14: &std::any::TypeId;
            let mut _15: &std::any::TypeId;
            scope 9 {
                debug t => _12;
                let _13: std::any::TypeId;
                scope 10 {
                    debug concrete => _13;
                    scope 12 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                        debug self => _14;
                        debug other => _15;
                        scope 13 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                            debug a => _14;
                            debug b => _15;
                            let mut _16: &[*const (); 2];
                            let mut _17: &[*const (); 2];
                            scope 14 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                                debug self => _16;
                                debug other => _17;
                                scope 15 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                    debug a => _16;
                                    debug b => _17;
                                    scope 16 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                        debug self => _16;
                                        debug index => const std::ops::RangeFull;
                                        let _18: &[*const ()];
                                        scope 17 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                            debug self => _18;
                                            debug index => const std::ops::RangeFull;
                                            scope 18 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                                debug slice => _18;
                                            }
                                        }
                                    }
                                    scope 19 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                        debug self => _17;
                                        debug index => const std::ops::RangeFull;
                                        let _19: &[*const ()];
                                        scope 20 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                            debug self => _19;
                                            debug index => const std::ops::RangeFull;
                                            scope 21 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                                debug slice => _19;
                                            }
                                        }
                                    }
                                    scope 22 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                        debug self => _18;
                                        debug other => _19;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            scope 11 (inlined std::any::TypeId::of::<T>) {
            }
        }
    }
    scope 23 (inlined std::sync::Arc::<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>::into_inner_with_allocator) {
        debug this => _5;
        let _20: std::mem::ManuallyDrop<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>;
        let mut _21: std::ptr::NonNull<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>;
        let mut _22: &std::mem::ManuallyDrop<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>;
        let mut _23: A;
        let mut _24: *const A;
        let mut _25: &std::mem::ManuallyDrop<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>;
        scope 24 {
            debug this => _20;
            scope 26 (inlined <std::mem::ManuallyDrop<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>> as std::ops::Deref>::deref) {
                debug self => _22;
            }
            scope 27 (inlined <std::mem::ManuallyDrop<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>> as std::ops::Deref>::deref) {
                debug self => _25;
            }
            scope 28 (inlined #[track_caller] std::ptr::read::<A>) {
                debug src => _24;
                let _26: ();
                let mut _27: *const ();
                let mut _28: usize;
                scope 29 (inlined core::ub_checks::check_language_ub) {
                    let mut _29: bool;
                    scope 30 (inlined core::ub_checks::check_language_ub::runtime) {
                    }
                }
                scope 31 (inlined std::mem::align_of::<A>) {
                }
            }
        }
        scope 25 (inlined std::mem::ManuallyDrop::<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>::new) {
            debug value => _5;
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_4);
        _4 = &_1;
        StorageLive(_9);
        StorageLive(_10);
        _10 = copy (_1.0: std::ptr::NonNull<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>);
        _9 = copy _10 as *const alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync> (Transmute);
        StorageDead(_10);
        _3 = &((*_9).2: dyn std::any::Any + std::marker::Send + std::marker::Sync);
        StorageDead(_9);
        StorageDead(_4);
        StorageLive(_11);
        _11 = copy _3 as &dyn std::any::Any (PointerCoercion(Unsize, Implicit));
        StorageLive(_12);
        _12 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_13);
        _13 = <dyn std::any::Any as std::any::Any>::type_id(move _11) -> [return: bb6, unwind: bb5];
    }

    bb1: {
        StorageLive(_5);
        _5 = move _1;
        StorageLive(_20);
        _20 = std::mem::ManuallyDrop::<std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>> { value: copy _5 };
        StorageLive(_22);
        _22 = &_20;
        StorageDead(_22);
        _21 = copy ((_20.0: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>).0: std::ptr::NonNull<alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync>>);
        StorageLive(_24);
        StorageLive(_25);
        _25 = &_20;
        StorageDead(_25);
        _24 = &raw const ((_20.0: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>).2: A);
        StorageLive(_29);
        _29 = UbChecks();
        switchInt(copy _29) -> [0: bb10, otherwise: bb8];
    }

    bb2: {
        _8 = move _1;
        _0 = std::result::Result::<std::sync::Arc<T, A>, std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>::Err(copy _8);
---
        StorageDead(_2);
        return;
    }

    bb4 (cleanup): {
        resume;
    }

    bb5 (cleanup): {
        drop(_1) -> [return: bb4, unwind terminate(cleanup)];
    }

    bb6: {
        StorageLive(_14);
        _14 = &_12;
        StorageLive(_15);
        _15 = &_13;
        StorageLive(_16);
        _16 = &(_12.0: [*const (); 2]);
        StorageLive(_17);
        _17 = &(_13.0: [*const (); 2]);
        StorageLive(_18);
        StorageLive(_19);
        _18 = copy _16 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _19 = copy _17 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _18, move _19) -> [return: bb7, unwind: bb5];
    }

    bb7: {
        StorageDead(_19);
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_16);
        StorageDead(_15);
        StorageDead(_14);
        StorageDead(_13);
        StorageDead(_12);
        StorageDead(_11);
        switchInt(move _2) -> [0: bb2, otherwise: bb1];
    }

    bb8: {
        StorageLive(_27);
        _27 = copy _24 as *const () (PtrToPtr);
        StorageLive(_28);
        _28 = AlignOf(A);
        _26 = std::ptr::read::precondition_check(move _27, move _28, const <A as std::mem::SizedTypeProperties>::IS_ZST) -> [return: bb9, unwind unreachable];
    }

    bb9: {
        StorageDead(_28);
        StorageDead(_27);
        goto -> bb10;
    }

    bb10: {
        _23 = copy ((_20.0: std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>).2: A);
        StorageDead(_29);
        StorageDead(_24);
        StorageDead(_20);
        StorageDead(_5);
        StorageLive(_6);
        StorageLive(_7);
        StorageLive(_31);
        StorageLive(_30);
        _31 = copy _21 as *mut alloc::sync::ArcInner<dyn std::any::Any + std::marker::Send + std::marker::Sync> (Transmute);
        _30 = copy _31 as *const alloc::sync::ArcInner<T> (PtrToPtr);
        _7 = std::ptr::NonNull::<alloc::sync::ArcInner<T>> { pointer: move _30 };
        StorageDead(_30);
        StorageDead(_31);
        _6 = std::sync::Arc::<T, A> { ptr: copy _7, phantom: const ZeroSized: std::marker::PhantomData<alloc::sync::ArcInner<T>>, alloc: copy _23 };
        StorageDead(_7);
        _0 = std::result::Result::<std::sync::Arc<T, A>, std::sync::Arc<dyn std::any::Any + std::marker::Send + std::marker::Sync, A>>::Ok(move _6);
        StorageDead(_6);
        goto -> bb3;
    }
}

---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <T as std::any::Any>::type_id(_1: &T) -> std::any::TypeId {
    debug self => _1;
    let mut _0: std::any::TypeId;
    scope 1 (inlined std::any::TypeId::of::<T>) {
    }

    bb0: {
        _0 = const std::any::TypeId::of::<T>::{constant#0};
        return;
    }
}


---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <(dyn std::any::Any + 'static)>::downcast_ref(_1: &dyn std::any::Any) -> std::option::Option<&T> {
    debug self => _1;
    let mut _0: std::option::Option<&T>;
    let mut _2: bool;
    let _3: &T;
    scope 1 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
        debug self => _1;
        let _4: std::any::TypeId;
        let mut _6: &std::any::TypeId;
        let mut _7: &std::any::TypeId;
        scope 2 {
            debug t => _4;
            let _5: std::any::TypeId;
            scope 3 {
                debug concrete => _5;
                scope 5 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                    debug self => _6;
                    debug other => _7;
                    scope 6 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                        debug a => _6;
                        debug b => _7;
                        let mut _8: &[*const (); 2];
                        let mut _9: &[*const (); 2];
                        scope 7 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                            debug self => _8;
                            debug other => _9;
                            scope 8 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                debug a => _8;
                                debug b => _9;
                                scope 9 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _8;
                                    debug index => const std::ops::RangeFull;
                                    let _10: &[*const ()];
                                    scope 10 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _10;
                                        debug index => const std::ops::RangeFull;
                                        scope 11 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _10;
                                        }
                                    }
                                }
                                scope 12 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _9;
                                    debug index => const std::ops::RangeFull;
                                    let _11: &[*const ()];
                                    scope 13 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _11;
                                        debug index => const std::ops::RangeFull;
                                        scope 14 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _11;
                                        }
                                    }
                                }
                                scope 15 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                    debug self => _10;
                                    debug other => _11;
                                }
                            }
                        }
                    }
                }
            }
        }
        scope 4 (inlined std::any::TypeId::of::<T>) {
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_4);
        _4 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_5);
        _5 = <dyn std::any::Any as std::any::Any>::type_id(copy _1) -> [return: bb5, unwind continue];
    }

    bb1: {
        _3 = <(dyn std::any::Any + 'static)>::downcast_ref_unchecked::<T>(move _1) -> [return: bb2, unwind continue];
    }

    bb2: {
        _0 = std::option::Option::<&T>::Some(copy _3);
        goto -> bb4;
    }

    bb3: {
        _0 = const {transmute(0x0000000000000000): std::option::Option<&T>};
        goto -> bb4;
    }

    bb4: {
        StorageDead(_2);
        return;
---
        _6 = &_4;
        StorageLive(_7);
        _7 = &_5;
        StorageLive(_8);
        _8 = &(_4.0: [*const (); 2]);
        StorageLive(_9);
        _9 = &(_5.0: [*const (); 2]);
        StorageLive(_10);
        StorageLive(_11);
        _10 = copy _8 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _11 = copy _9 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _10, move _11) -> [return: bb6, unwind continue];
    }

    bb6: {
        StorageDead(_11);
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_7);
        StorageDead(_6);
        StorageDead(_5);
        StorageDead(_4);
        switchInt(move _2) -> [0: bb3, otherwise: bb1];
    }
}


thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/constant.rs:383:25:
---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn std::boxed::convert::<impl std::boxed::Box<(dyn std::any::Any + 'static), A>>::downcast_unchecked(_1: std::boxed::Box<dyn std::any::Any, A>) -> std::boxed::Box<T, A> {
    debug self => _1;
    let mut _0: std::boxed::Box<T, A>;
    let mut _2: bool;
    let mut _3: &dyn std::any::Any;
    let mut _4: !;
    let _5: *mut dyn std::any::Any;
    let _6: A;
    let mut _7: std::boxed::Box<dyn std::any::Any, A>;
    let mut _8: *mut T;
    let mut _9: A;
    let mut _10: *const dyn std::any::Any;
    scope 1 {
        debug raw => _5;
        debug alloc => _6;
        scope 28 (inlined std::boxed::Box::<T, A>::from_raw_in) {
            debug raw => _8;
            debug alloc => _9;
            let mut _30: std::ptr::Unique<T>;
            scope 29 (inlined std::ptr::Unique::<T>::new_unchecked) {
                debug ptr => _8;
                let mut _31: std::ptr::NonNull<T>;
                scope 30 (inlined #[track_caller] std::ptr::NonNull::<T>::new_unchecked) {
                    debug ptr => _8;
                    let _32: ();
                    let mut _33: *mut ();
                    let mut _34: *const T;
                    scope 31 (inlined core::ub_checks::check_language_ub) {
                        scope 32 (inlined core::ub_checks::check_language_ub::runtime) {
                        }
                    }
                }
            }
        }
    }
    scope 2 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
        debug self => _10;
        let _11: std::any::TypeId;
        let mut _13: &std::any::TypeId;
        let mut _14: &std::any::TypeId;
        scope 3 {
            debug t => _11;
            let _12: std::any::TypeId;
            scope 4 {
                debug concrete => _12;
                scope 6 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                    debug self => _13;
                    debug other => _14;
                    scope 7 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                        debug a => _13;
                        debug b => _14;
                        let mut _15: &[*const (); 2];
                        let mut _16: &[*const (); 2];
                        scope 8 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                            debug self => _15;
                            debug other => _16;
                            scope 9 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                debug a => _15;
                                debug b => _16;
                                scope 10 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _15;
                                    debug index => const std::ops::RangeFull;
                                    let _17: &[*const ()];
                                    scope 11 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _17;
                                        debug index => const std::ops::RangeFull;
                                        scope 12 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _17;
                                        }
                                    }
                                }
                                scope 13 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _16;
                                    debug index => const std::ops::RangeFull;
                                    let _18: &[*const ()];
                                    scope 14 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _18;
                                        debug index => const std::ops::RangeFull;
                                        scope 15 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _18;
                                        }
                                    }
                                }
                                scope 16 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                    debug self => _17;
                                    debug other => _18;
                                }
                            }
                        }
                    }
                }
            }
        }
        scope 5 (inlined std::any::TypeId::of::<T>) {
        }
    }
    scope 17 (inlined std::boxed::Box::<dyn std::any::Any, A>::into_raw_with_allocator) {
        debug b => _7;
        let mut _19: std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any, A>>;
        let mut _21: &mut std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any, A>>;
        let mut _23: *const A;
        let mut _24: &std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any, A>>;
        let mut _25: *const dyn std::any::Any;
        let mut _35: std::ptr::NonNull<dyn std::any::Any>;
        scope 18 {
            debug b => _19;
            let _20: *mut dyn std::any::Any;
            scope 19 {
                debug ptr => _20;
                let _22: A;
                scope 20 {
                    debug alloc => _22;
                }
                scope 23 (inlined <std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any, A>> as std::ops::Deref>::deref) {
                    debug self => _24;
                }
                scope 24 (inlined #[track_caller] std::ptr::read::<A>) {
                    debug src => _23;
                    let _26: ();
                    let mut _27: *const ();
                    let mut _28: usize;
                    scope 25 (inlined core::ub_checks::check_language_ub) {
                        let mut _29: bool;
                        scope 26 (inlined core::ub_checks::check_language_ub::runtime) {
                        }
                    }
                    scope 27 (inlined std::mem::align_of::<A>) {
                    }
                }
            }
            scope 22 (inlined <std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any, A>> as std::ops::DerefMut>::deref_mut) {
                debug self => _21;
            }
        }
        scope 21 (inlined std::mem::ManuallyDrop::<std::boxed::Box<dyn std::any::Any, A>>::new) {
            debug value => _7;
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_3);
        _10 = copy ((_1.0: std::ptr::Unique<dyn std::any::Any>).0: std::ptr::NonNull<dyn std::any::Any>) as *const dyn std::any::Any (Transmute);
        _3 = &(*_10);
        StorageLive(_11);
        _11 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_12);
        _12 = <dyn std::any::Any as std::any::Any>::type_id(move _3) -> [return: bb5, unwind: bb4];
    }

    bb1: {
        StorageDead(_3);
        StorageDead(_2);
        _7 = move _1;
        StorageLive(_21);
        StorageLive(_35);
        StorageLive(_25);
        StorageLive(_19);
        _19 = std::mem::ManuallyDrop::<std::boxed::Box<dyn std::any::Any, A>> { value: copy _7 };
        _21 = &mut _19;
        _35 = copy (((_19.0: std::boxed::Box<dyn std::any::Any, A>).0: std::ptr::Unique<dyn std::any::Any>).0: std::ptr::NonNull<dyn std::any::Any>);
        _25 = copy _35 as *const dyn std::any::Any (Transmute);
        _20 = &raw mut (*_25);
        StorageLive(_23);
        StorageLive(_24);
        _24 = &_19;
        StorageDead(_24);
        _23 = &raw const ((_19.0: std::boxed::Box<dyn std::any::Any, A>).1: A);
        _29 = UbChecks();
        switchInt(copy _29) -> [0: bb9, otherwise: bb7];
    }

    bb2: {
        StorageDead(_3);
        _4 = core::panicking::panic(const "assertion failed: self.is::<T>()") -> bb4;
    }

    bb3 (cleanup): {
        resume;
    }

    bb4 (cleanup): {
        drop(_1) -> [return: bb3, unwind terminate(cleanup)];
    }

    bb5: {
        StorageLive(_13);
        _13 = &_11;
        StorageLive(_14);
        _14 = &_12;
        StorageLive(_15);
        _15 = &(_11.0: [*const (); 2]);
        StorageLive(_16);
        _16 = &(_12.0: [*const (); 2]);
        StorageLive(_17);
        StorageLive(_18);
        _17 = copy _15 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _18 = copy _16 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _17, move _18) -> [return: bb6, unwind: bb4];
    }

    bb6: {
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_16);
        StorageDead(_15);
        StorageDead(_14);
        StorageDead(_13);
        StorageDead(_12);
        StorageDead(_11);
        switchInt(move _2) -> [0: bb2, otherwise: bb1];
    }

    bb7: {
        StorageLive(_27);
        _27 = copy _23 as *const () (PtrToPtr);
        StorageLive(_28);
        _28 = AlignOf(A);
        _26 = std::ptr::read::precondition_check(move _27, move _28, const <A as std::mem::SizedTypeProperties>::IS_ZST) -> [return: bb8, unwind unreachable];
    }

    bb8: {
        StorageDead(_28);
        StorageDead(_27);
        _22 = copy ((_19.0: std::boxed::Box<dyn std::any::Any, A>).1: A);
        StorageDead(_23);
        StorageDead(_19);
        StorageDead(_25);
        StorageDead(_35);
        StorageDead(_21);
        StorageLive(_5);
        _5 = copy _20;
        StorageLive(_6);
        _6 = copy _22;
        StorageLive(_8);
        _8 = copy _20 as *mut T (PtrToPtr);
        StorageLive(_9);
        _9 = copy _22;
        StorageLive(_30);
        StorageLive(_31);
        StorageLive(_34);
        goto -> bb10;
    }

    bb9: {
        _22 = copy ((_19.0: std::boxed::Box<dyn std::any::Any, A>).1: A);
        StorageDead(_23);
        StorageDead(_19);
        StorageDead(_25);
        StorageDead(_35);
        StorageDead(_21);
        StorageLive(_5);
        _5 = copy _20;
        StorageLive(_6);
        _6 = copy _22;
        StorageLive(_8);
        _8 = copy _20 as *mut T (PtrToPtr);
        StorageLive(_9);
        _9 = copy _22;
        StorageLive(_30);
        StorageLive(_31);
        StorageLive(_34);
        switchInt(copy _29) -> [0: bb12, otherwise: bb10];
    }

    bb10: {
        StorageLive(_33);
        _33 = copy _20 as *mut () (PtrToPtr);
        _32 = std::ptr::NonNull::<T>::new_unchecked::precondition_check(move _33) -> [return: bb11, unwind unreachable];
    }

    bb11: {
        StorageDead(_33);
        goto -> bb12;
    }

    bb12: {
        _34 = copy _20 as *const T (PtrToPtr);
        _31 = std::ptr::NonNull::<T> { pointer: copy _34 };
        StorageDead(_34);
        _30 = std::ptr::Unique::<T> { pointer: move _31, _marker: const ZeroSized: std::marker::PhantomData<T> };
        StorageDead(_31);
        _0 = std::boxed::Box::<T, A>(move _30, copy _22);
        StorageDead(_30);
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_6);
        StorageDead(_5);
---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_27_07-20939.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <T as std::any::Any>::type_id(_1: &T) -> std::any::TypeId {
    debug self => _1;
    let mut _0: std::any::TypeId;
    scope 1 (inlined std::any::TypeId::of::<T>) {
    }

    bb0: {
        _0 = const std::any::TypeId::of::<T>::{constant#0};
        return;
    }
}

[RUSTC-TIMING] alloctests test:true 12.593
error: could not compile `alloctests` (test "alloctests")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustc-clif --crate-name alloctests --edition=2021 alloctests/tests/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs --check-cfg 'cfg(no_global_oom_handling)' --check-cfg 'cfg(no_rc)' --check-cfg 'cfg(no_sync)' --check-cfg 'cfg(randomized_layouts)' --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=3cacf3b900baf69b -C extra-filename=-96b52c9fcd69953c --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/debug/deps --extern alloctests=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/liballoctests-81e62d275465410b.rlib --extern rand=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand-317f0949b407aee9.rlib --extern rand_xorshift=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand_xorshift-4cad3ad5e73d32bc.rlib -Csymbol-mangling-version=v0 -Zrandomize-layout -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off -Clink-arg=-L/usr/lib/llvm-19/lib -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages --cap-lints=allow --cfg randomized_layouts` (exit status: 101)

thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/constant.rs:383:25:
internal error: entered unreachable code
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_26_58-20887.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn std::error::Error::type_id(_1: &Self, _2: core::error::private::Internal) -> std::any::TypeId {
    debug self => _1;
    let mut _0: std::any::TypeId;
    scope 1 (inlined std::any::TypeId::of::<Self>) {
    }

    bb0: {
        _0 = const std::any::TypeId::of::<Self>::{constant#0};
        return;
    }
}


---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_26_58-20887.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <(dyn std::any::Any + 'static)>::downcast_mut(_1: &mut dyn std::any::Any) -> std::option::Option<&mut T> {
    debug self => _1;
    let mut _0: std::option::Option<&mut T>;
    let mut _2: bool;
    let mut _3: &dyn std::any::Any;
    let mut _4: &mut T;
    scope 1 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
        debug self => _1;
        let _5: std::any::TypeId;
        let mut _7: &std::any::TypeId;
        let mut _8: &std::any::TypeId;
        scope 2 {
            debug t => _5;
            let _6: std::any::TypeId;
            scope 3 {
                debug concrete => _6;
                scope 5 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                    debug self => _7;
                    debug other => _8;
                    scope 6 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                        debug a => _7;
                        debug b => _8;
                        let mut _9: &[*const (); 2];
                        let mut _10: &[*const (); 2];
                        scope 7 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                            debug self => _9;
                            debug other => _10;
                            scope 8 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                debug a => _9;
                                debug b => _10;
                                scope 9 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _9;
                                    debug index => const std::ops::RangeFull;
                                    let _11: &[*const ()];
                                    scope 10 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _11;
                                        debug index => const std::ops::RangeFull;
                                        scope 11 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _11;
                                        }
                                    }
                                }
                                scope 12 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                    debug self => _10;
                                    debug index => const std::ops::RangeFull;
                                    let _12: &[*const ()];
                                    scope 13 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                        debug self => _12;
                                        debug index => const std::ops::RangeFull;
                                        scope 14 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                            debug slice => _12;
                                        }
                                    }
                                }
                                scope 15 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                    debug self => _11;
                                    debug other => _12;
                                }
                            }
                        }
                    }
                }
            }
        }
        scope 4 (inlined std::any::TypeId::of::<T>) {
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_3);
        _3 = &(*_1);
        StorageLive(_5);
        _5 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_6);
        _6 = <dyn std::any::Any as std::any::Any>::type_id(move _3) -> [return: bb5, unwind continue];
    }

    bb1: {
        StorageDead(_3);
        _4 = <(dyn std::any::Any + 'static)>::downcast_mut_unchecked::<T>(move _1) -> [return: bb2, unwind continue];
    }

    bb2: {
        _0 = std::option::Option::<&mut T>::Some(copy _4);
        goto -> bb4;
    }

    bb3: {
        StorageDead(_3);
        _0 = const {transmute(0x0000000000000000): std::option::Option<&mut T>};
        goto -> bb4;
    }

    bb4: {
        StorageDead(_2);
        return;
---
        _7 = &_5;
        StorageLive(_8);
        _8 = &_6;
        StorageLive(_9);
        _9 = &(_5.0: [*const (); 2]);
        StorageLive(_10);
        _10 = &(_6.0: [*const (); 2]);
        StorageLive(_11);
        StorageLive(_12);
        _11 = copy _9 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _12 = copy _10 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _11, move _12) -> [return: bb6, unwind continue];
    }

    bb6: {
        StorageDead(_12);
        StorageDead(_11);
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_7);
        StorageDead(_6);
        StorageDead(_5);
        switchInt(move _2) -> [0: bb3, otherwise: bb1];
    }
}


thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/constant.rs:383:25:
---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_26_58-20887.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn <T as std::any::Any>::type_id(_1: &T) -> std::any::TypeId {
    debug self => _1;
    let mut _0: std::any::TypeId;
    scope 1 (inlined std::any::TypeId::of::<T>) {
    }

    bb0: {
        _0 = const std::any::TypeId::of::<T>::{constant#0};
        return;
    }
}


---
   1: core::panicking::panic_fmt
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/panicking.rs:145:5
   3: <rustc_codegen_cranelift::constant::ConstantCx>::finalize
   4: rustc_codegen_cranelift::base::codegen_fn
   5: rustc_codegen_cranelift::driver::aot::module_codegen
   6: rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}
   7: <&mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3} as core::ops::function::FnMut<((usize, &rustc_middle::mir::mono::CodegenUnit),)>>::call_mut
   8: <alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(usize, &rustc_middle::mir::mono::CodegenUnit), rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, &mut rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>>
   9: <alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, core::iter::adapters::filter_map::FilterMap<alloc::vec::into_iter::IntoIter<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::sync::parallel::par_map<(usize, &rustc_middle::mir::mono::CodegenUnit), alloc::vec::Vec<(usize, &rustc_middle::mir::mono::CodegenUnit)>, rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, alloc::vec::Vec<rustc_data_structures::marker::IntoDynSyncSend<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}::{closure#0}>::{closure#0}::{closure#3}>>>::from_iter
  10: <rustc_session::session::Session>::time::<alloc::vec::Vec<rustc_codegen_cranelift::driver::aot::OngoingModuleCodegen>, rustc_codegen_cranelift::driver::aot::run_aot::{closure#3}>
  11: rustc_codegen_cranelift::driver::aot::run_aot
  12: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  14: rustc_interface::passes::start_codegen
  15: <rustc_interface::queries::Linker>::codegen_and_build_linker
  16: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  17: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  18: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  19: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
  20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: please attach the file at `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/rustc-ice-2025-06-24T14_26_58-20887.txt` to your bug report

note: compiler flags: -C panic=abort -Z panic-abort-tests -Z codegen-backend=cranelift -C embed-bitcode=no -C debuginfo=2 -C symbol-mangling-version=v0 -Z randomize-layout -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -C link-arg=-L/usr/lib/llvm-19/lib -C llvm-args=-import-instr-limit=10 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -Z force-unstable-if-unmarked

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

query stack during panic:
end of query stack
fn std::boxed::convert::<impl std::boxed::Box<(dyn std::any::Any + std::marker::Send + 'static), A>>::downcast_unchecked(_1: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>) -> std::boxed::Box<T, A> {
    debug self => _1;
    let mut _0: std::boxed::Box<T, A>;
    let mut _2: bool;
    let mut _3: &dyn std::any::Any + std::marker::Send;
    let mut _4: !;
    let _5: *mut dyn std::any::Any + std::marker::Send;
    let _6: A;
    let mut _7: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>;
    let mut _8: *mut T;
    let mut _9: A;
    let mut _10: *const dyn std::any::Any + std::marker::Send;
    scope 1 {
        debug raw => _5;
        debug alloc => _6;
        scope 29 (inlined std::boxed::Box::<T, A>::from_raw_in) {
            debug raw => _8;
            debug alloc => _9;
            let mut _31: std::ptr::Unique<T>;
            scope 30 (inlined std::ptr::Unique::<T>::new_unchecked) {
                debug ptr => _8;
                let mut _32: std::ptr::NonNull<T>;
                scope 31 (inlined #[track_caller] std::ptr::NonNull::<T>::new_unchecked) {
                    debug ptr => _8;
                    let _33: ();
                    let mut _34: *mut ();
                    let mut _35: *const T;
                    scope 32 (inlined core::ub_checks::check_language_ub) {
                        scope 33 (inlined core::ub_checks::check_language_ub::runtime) {
                        }
                    }
                }
            }
        }
    }
    scope 2 (inlined <(dyn std::any::Any + std::marker::Send + 'static)>::is::<T>) {
        debug self => _10;
        let mut _11: &dyn std::any::Any;
        scope 3 (inlined <(dyn std::any::Any + 'static)>::is::<T>) {
            debug self => _11;
            let _12: std::any::TypeId;
            let mut _14: &std::any::TypeId;
            let mut _15: &std::any::TypeId;
            scope 4 {
                debug t => _12;
                let _13: std::any::TypeId;
                scope 5 {
                    debug concrete => _13;
                    scope 7 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq) {
                        debug self => _14;
                        debug other => _15;
                        scope 8 (inlined <std::any::TypeId as std::cmp::PartialEq>::eq::rt) {
                            debug a => _14;
                            debug b => _15;
                            let mut _16: &[*const (); 2];
                            let mut _17: &[*const (); 2];
                            scope 9 (inlined std::array::equality::<impl std::cmp::PartialEq for [*const (); 2]>::eq) {
                                debug self => _16;
                                debug other => _17;
                                scope 10 (inlined <*const () as std::array::equality::SpecArrayEq<*const (), 2>>::spec_eq) {
                                    debug a => _16;
                                    debug b => _17;
                                    scope 11 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                        debug self => _16;
                                        debug index => const std::ops::RangeFull;
                                        let _18: &[*const ()];
                                        scope 12 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                            debug self => _18;
                                            debug index => const std::ops::RangeFull;
                                            scope 13 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                                debug slice => _18;
                                            }
                                        }
                                    }
                                    scope 14 (inlined #[track_caller] std::array::<impl std::ops::Index<std::ops::RangeFull> for [*const (); 2]>::index) {
                                        debug self => _17;
                                        debug index => const std::ops::RangeFull;
                                        let _19: &[*const ()];
                                        scope 15 (inlined #[track_caller] core::slice::index::<impl std::ops::Index<std::ops::RangeFull> for [*const ()]>::index) {
                                            debug self => _19;
                                            debug index => const std::ops::RangeFull;
                                            scope 16 (inlined #[track_caller] <std::ops::RangeFull as std::slice::SliceIndex<[*const ()]>>::index) {
                                                debug slice => _19;
                                            }
                                        }
                                    }
                                    scope 17 (inlined core::slice::cmp::<impl std::cmp::PartialEq for [*const ()]>::eq) {
                                        debug self => _18;
                                        debug other => _19;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            scope 6 (inlined std::any::TypeId::of::<T>) {
            }
        }
    }
    scope 18 (inlined std::boxed::Box::<dyn std::any::Any + std::marker::Send, A>::into_raw_with_allocator) {
        debug b => _7;
        let mut _20: std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>>;
        let mut _22: &mut std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>>;
        let mut _24: *const A;
        let mut _25: &std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>>;
        let mut _26: *const dyn std::any::Any + std::marker::Send;
        let mut _36: std::ptr::NonNull<dyn std::any::Any + std::marker::Send>;
        scope 19 {
            debug b => _20;
            let _21: *mut dyn std::any::Any + std::marker::Send;
            scope 20 {
                debug ptr => _21;
                let _23: A;
                scope 21 {
                    debug alloc => _23;
                }
                scope 24 (inlined <std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>> as std::ops::Deref>::deref) {
                    debug self => _25;
                }
                scope 25 (inlined #[track_caller] std::ptr::read::<A>) {
                    debug src => _24;
                    let _27: ();
                    let mut _28: *const ();
                    let mut _29: usize;
                    scope 26 (inlined core::ub_checks::check_language_ub) {
                        let mut _30: bool;
                        scope 27 (inlined core::ub_checks::check_language_ub::runtime) {
                        }
                    }
                    scope 28 (inlined std::mem::align_of::<A>) {
                    }
                }
            }
            scope 23 (inlined <std::mem::ManuallyDrop<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>> as std::ops::DerefMut>::deref_mut) {
                debug self => _22;
            }
        }
        scope 22 (inlined std::mem::ManuallyDrop::<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>>::new) {
            debug value => _7;
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_3);
        _10 = copy ((_1.0: std::ptr::Unique<dyn std::any::Any + std::marker::Send>).0: std::ptr::NonNull<dyn std::any::Any + std::marker::Send>) as *const dyn std::any::Any + std::marker::Send (Transmute);
        _3 = &(*_10);
        StorageLive(_11);
        _11 = copy _3 as &dyn std::any::Any (PointerCoercion(Unsize, Implicit));
        StorageLive(_12);
        _12 = const std::any::TypeId::of::<T>::{constant#0};
        StorageLive(_13);
        _13 = <dyn std::any::Any as std::any::Any>::type_id(move _11) -> [return: bb5, unwind: bb4];
    }

    bb1: {
        StorageDead(_3);
        StorageDead(_2);
        _7 = move _1;
        StorageLive(_22);
        StorageLive(_36);
        StorageLive(_26);
        StorageLive(_20);
        _20 = std::mem::ManuallyDrop::<std::boxed::Box<dyn std::any::Any + std::marker::Send, A>> { value: copy _7 };
        _22 = &mut _20;
        _36 = copy (((_20.0: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>).0: std::ptr::Unique<dyn std::any::Any + std::marker::Send>).0: std::ptr::NonNull<dyn std::any::Any + std::marker::Send>);
        _26 = copy _36 as *const dyn std::any::Any + std::marker::Send (Transmute);
        _21 = &raw mut (*_26);
        StorageLive(_24);
        StorageLive(_25);
        _25 = &_20;
        StorageDead(_25);
        _24 = &raw const ((_20.0: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>).1: A);
        _30 = UbChecks();
        switchInt(copy _30) -> [0: bb9, otherwise: bb7];
    }

    bb2: {
        StorageDead(_3);
        _4 = core::panicking::panic(const "assertion failed: self.is::<T>()") -> bb4;
    }

    bb3 (cleanup): {
        resume;
    }

    bb4 (cleanup): {
        drop(_1) -> [return: bb3, unwind terminate(cleanup)];
    }

    bb5: {
        StorageLive(_14);
        _14 = &_12;
        StorageLive(_15);
        _15 = &_13;
        StorageLive(_16);
        _16 = &(_12.0: [*const (); 2]);
        StorageLive(_17);
        _17 = &(_13.0: [*const (); 2]);
        StorageLive(_18);
        StorageLive(_19);
        _18 = copy _16 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _19 = copy _17 as &[*const ()] (PointerCoercion(Unsize, AsCast));
        _2 = <[*const ()] as core::slice::cmp::SlicePartialEq<*const ()>>::equal(move _18, move _19) -> [return: bb6, unwind: bb4];
    }

    bb6: {
        StorageDead(_19);
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_16);
        StorageDead(_15);
        StorageDead(_14);
        StorageDead(_13);
        StorageDead(_12);
        StorageDead(_11);
        switchInt(move _2) -> [0: bb2, otherwise: bb1];
    }

    bb7: {
        StorageLive(_28);
        _28 = copy _24 as *const () (PtrToPtr);
        StorageLive(_29);
        _29 = AlignOf(A);
        _27 = std::ptr::read::precondition_check(move _28, move _29, const <A as std::mem::SizedTypeProperties>::IS_ZST) -> [return: bb8, unwind unreachable];
    }

    bb8: {
        StorageDead(_29);
        StorageDead(_28);
        _23 = copy ((_20.0: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>).1: A);
        StorageDead(_24);
        StorageDead(_20);
        StorageDead(_26);
        StorageDead(_36);
        StorageDead(_22);
        StorageLive(_5);
        _5 = copy _21;
        StorageLive(_6);
        _6 = copy _23;
        StorageLive(_8);
        _8 = copy _21 as *mut T (PtrToPtr);
        StorageLive(_9);
        _9 = copy _23;
        StorageLive(_31);
        StorageLive(_32);
        StorageLive(_35);
        goto -> bb10;
    }

    bb9: {
        _23 = copy ((_20.0: std::boxed::Box<dyn std::any::Any + std::marker::Send, A>).1: A);
        StorageDead(_24);
        StorageDead(_20);
        StorageDead(_26);
        StorageDead(_36);
        StorageDead(_22);
        StorageLive(_5);
        _5 = copy _21;
        StorageLive(_6);
        _6 = copy _23;
        StorageLive(_8);
        _8 = copy _21 as *mut T (PtrToPtr);
        StorageLive(_9);
        _9 = copy _23;
        StorageLive(_31);
        StorageLive(_32);
        StorageLive(_35);
        switchInt(copy _30) -> [0: bb12, otherwise: bb10];
    }

    bb10: {
        StorageLive(_34);
        _34 = copy _21 as *mut () (PtrToPtr);
        _33 = std::ptr::NonNull::<T>::new_unchecked::precondition_check(move _34) -> [return: bb11, unwind unreachable];
    }

    bb11: {
        StorageDead(_34);
        goto -> bb12;
    }

    bb12: {
        _35 = copy _21 as *const T (PtrToPtr);
        _32 = std::ptr::NonNull::<T> { pointer: copy _35 };
        StorageDead(_35);
        _31 = std::ptr::Unique::<T> { pointer: move _32, _marker: const ZeroSized: std::marker::PhantomData<T> };
        StorageDead(_32);
        _0 = std::boxed::Box::<T, A>(move _31, copy _23);
        StorageDead(_31);
        StorageDead(_9);
        StorageDead(_8);
        StorageDead(_6);
        StorageDead(_5);
---
[RUSTC-TIMING] coretests test:true 62.528
error: could not compile `coretests` (test "coretests")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustc-clif --crate-name coretests --edition=2024 coretests/tests/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --warn=unexpected_cfgs --check-cfg 'cfg(target_has_reliable_f16)' --check-cfg 'cfg(target_has_reliable_f16_math)' --check-cfg 'cfg(target_has_reliable_f128)' --check-cfg 'cfg(target_has_reliable_f128_math)' --test --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=902db7fd19d6457a -C extra-filename=-4a5a69e544523748 --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/debug/deps --extern coretests=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/libcoretests-d53c284ce10aa626.rlib --extern rand=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand-317f0949b407aee9.rlib --extern rand_xorshift=/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target/aarch64-unknown-linux-gnu/debug/deps/librand_xorshift-4cad3ad5e73d32bc.rlib -Csymbol-mangling-version=v0 -Zrandomize-layout -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=off -Clink-arg=-L/usr/lib/llvm-19/lib -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages --cap-lints=allow --cfg randomized_layouts` (exit status: 101)
env -u RUSTC_WRAPPER CARGO_ENCODED_RUSTDOCFLAGS="-Csymbol-mangling-version=v0\u{1f}-Zrandomize-layout\u{1f}-Zunstable-options\u{1f}--check-cfg=cfg(bootstrap)\u{1f}--check-cfg=cfg(llvm_enzyme)\u{1f}-Dwarnings\u{1f}-Wrustdoc::invalid_codeblock_attributes\u{1f}--crate-version\u{1f}1.90.0-nightly\t(7ae63cee3\t2025-06-24)" CARGO_ENCODED_RUSTFLAGS="-Csymbol-mangling-version=v0\u{1f}-Zrandomize-layout\u{1f}-Zunstable-options\u{1f}--check-cfg=cfg(bootstrap)\u{1f}--check-cfg=cfg(llvm_enzyme)\u{1f}-Zmacro-backtrace\u{1f}-Csplit-debuginfo=off\u{1f}-Clink-arg=-L/usr/lib/llvm-19/lib\u{1f}-Cllvm-args=-import-instr-limit=10\u{1f}-Clink-args=-Wl,-z,origin\u{1f}-Clink-args=-Wl,-rpath,$ORIGIN/../lib\u{1f}-Alinker-messages\u{1f}--cap-lints=allow\u{1f}--cfg\u{1f}randomized_layouts" RUSTC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustc-clif" RUSTDOC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/dist/rustdoc-clif" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "test" "--manifest-path" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests/Cargo.toml" "--target-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools/cg_clif/build/sysroot_tests_target" "--locked" "--target" "aarch64-unknown-linux-gnu" "-p" "coretests" "-p" "alloctests" "--tests" "--" "-q" exited with status ExitStatus(unix_wait_status(25856))
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:12:10
  local time: Tue Jun 24 14:28:01 UTC 2025
  network time: Tue, 24 Jun 2025 14:28:01 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants