Skip to content

ICE building glam: Projecting into SIMD type std::arch::aarch64::float32x4_t is banned by MCP#838 #144621

Closed

Description

@kpreid

Code

[package]
name = "foo"
version = "0.1.0"
edition = "2024"

[dependencies]
glam = { version = "0.30.5" }

[profile.dev]
opt-level = 2
overflow-checks = true

Then cargo check or cargo build.

Meta

rustc --version --verbose:

rustc 1.90.0-nightly (498ae9fed 2025-07-28)
binary: rustc
commit-hash: 498ae9fed2e7d90821d70a048f3770f91af08957
commit-date: 2025-07-28
host: aarch64-apple-darwin
release: 1.90.0-nightly
LLVM version: 20.1.8

Error output

error: internal compiler error: compiler/rustc_mir_transform/src/validate.rs:80:25: broken MIR in Item(DefId(0:35261 ~ glam[4582]::euler::{impl#44}::to_euler_angles)) (after phase change to runtime-optimized) at bb0[5]:
                                Projecting into SIMD type std::arch::aarch64::float32x4_t is banned by MCP#838
   --> /Users/kpreid/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glam-0.30.5/src/euler.rs:410:34
    |
410 |                 $mat3::from_mat4(self).to_euler_angles(order)
    |                                  ^^^^
...
435 | impl_mat4_to_euler!(f32, Mat4, Mat3);
    | ------------------------------------ in this macro invocation
    |
    = note: this error: internal compiler error originates in the macro `impl_mat4_to_euler` (in Nightly builds, run with -Z macro-backtrace for more info)


thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:80:25:
Box<dyn Any>
Backtrace

stack backtrace:
   0:        0x10e89cb4c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h2c8dadb96be3f8dc
   1:        0x10bd78670 - core::fmt::write::haea1839b4421f097
   2:        0x10e891184 - std::io::Write::write_fmt::h829d20f6c5614c8f
   3:        0x10e89ca0c - std::sys::backtrace::BacktraceLock::print::h9d16fad313b69287
   4:        0x10e8a15c0 - std::panicking::default_hook::{{closure}}::hd647fc9fea98ee68
   5:        0x10e8a1298 - std::panicking::default_hook::h438fdb7239b92b6b
   6:        0x10c96f1ac - rustc_driver_impl[c764e17e85da8204]::install_ice_hook::{closure#1}
   7:        0x10e8a1f4c - std::panicking::rust_panic_with_hook::h14f7a21fdd463b8b
   8:        0x10c99f534 - std[b05d56cfd8fca740]::panicking::begin_panic::<rustc_errors[1c7534ae315a5042]::ExplicitBug>::{closure#0}
   9:        0x10c98df40 - std[b05d56cfd8fca740]::sys::backtrace::__rust_end_short_backtrace::<std[b05d56cfd8fca740]::panicking::begin_panic<rustc_errors[1c7534ae315a5042]::ExplicitBug>::{closure#0}, !>
  10:        0x11153f890 - std[b05d56cfd8fca740]::panicking::begin_panic::<rustc_errors[1c7534ae315a5042]::ExplicitBug>
  11:        0x11153fdd0 - <rustc_errors[1c7534ae315a5042]::diagnostic::BugAbort as rustc_errors[1c7534ae315a5042]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:        0x1115ae330 - <rustc_errors[1c7534ae315a5042]::DiagCtxtHandle>::span_bug::<rustc_span[383248f629c63a7f]::span_encoding::Span, alloc[e2705810b410854d]::string::String>
  13:        0x1115b7208 - rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt::<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}
  14:        0x10d61951c - rustc_middle[ff00f450670e31a2]::ty::context::tls::with_opt::<rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:        0x10d618fe4 - rustc_middle[ff00f450670e31a2]::ty::context::tls::with_context_opt::<rustc_middle[ff00f450670e31a2]::ty::context::tls::with_opt<rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:        0x1115b7178 - rustc_middle[ff00f450670e31a2]::util::bug::span_bug_fmt::<rustc_span[383248f629c63a7f]::span_encoding::Span>
  17:        0x10d9a6a08 - <rustc_mir_transform[c3f80c3e19acb41d]::validate::CfgChecker>::fail::<alloc[e2705810b410854d]::string::String>
  18:        0x10d9a5b34 - <rustc_mir_transform[c3f80c3e19acb41d]::validate::Validator as rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::MirPass>::run_pass
  19:        0x10d8f7198 - rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::run_passes_inner
  20:        0x10d91bf5c - rustc_mir_transform[c3f80c3e19acb41d]::run_optimization_passes
  21:        0x10d91c3c0 - rustc_mir_transform[c3f80c3e19acb41d]::optimized_mir
  22:        0x10e00eb50 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>
  23:        0x10dde78e0 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefIdCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
  24:        0x10e02b5f8 - rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  25:        0x10d8f8f5c - rustc_mir_transform[c3f80c3e19acb41d]::cross_crate_inline::cross_crate_inlinable
  26:        0x10e011cd4 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::cross_crate_inlinable::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 1usize]>>
  27:        0x10dddc258 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefIdCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
  28:        0x10e0a4a0c - rustc_query_impl[710479fe5bc1800b]::query_impl::cross_crate_inlinable::get_query_non_incr::__rust_end_short_backtrace
  29:        0x10dc61150 - rustc_passes[dfb39456de595ce0]::reachable::recursively_reachable
  30:        0x10dc63b3c - rustc_passes[dfb39456de595ce0]::reachable::reachable_set
  31:        0x10e00ebcc - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::reachable_set::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>
  32:        0x10ddf4c54 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::SingleCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
  33:        0x10e04e888 - rustc_query_impl[710479fe5bc1800b]::query_impl::reachable_set::get_query_non_incr::__rust_end_short_backtrace
  34:        0x10d49eff8 - <rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::EncodeContext>::encode_crate_root
  35:        0x111598df4 - rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata::{closure#3}::{closure#0}
  36:        0x10d47bf10 - <rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata::{closure#3} as core[9fdc13437c3067b0]::ops::function::FnOnce<(rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt, &std[b05d56cfd8fca740]::path::Path)>>::call_once
  37:        0x10d5039e0 - rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata
  38:        0x10d4ca17c - rustc_metadata[7a8e59b443ce0166]::fs::encode_and_write_metadata
  39:        0x10d259450 - <rustc_interface[57fce32a49ee6398]::queries::Linker>::codegen_and_build_linker
  40:        0x10c8d8060 - rustc_interface[57fce32a49ee6398]::passes::create_and_enter_global_ctxt::<core[9fdc13437c3067b0]::option::Option<rustc_interface[57fce32a49ee6398]::queries::Linker>, rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}::{closure#2}>
  41:        0x10c91fd88 - rustc_interface[57fce32a49ee6398]::interface::run_compiler::<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}
  42:        0x10c9151f4 - std[b05d56cfd8fca740]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[57fce32a49ee6398]::util::run_in_thread_with_globals<rustc_interface[57fce32a49ee6398]::util::run_in_thread_pool_with_globals<rustc_interface[57fce32a49ee6398]::interface::run_compiler<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  43:        0x10c9220c4 - <<std[b05d56cfd8fca740]::thread::Builder>::spawn_unchecked_<rustc_interface[57fce32a49ee6398]::util::run_in_thread_with_globals<rustc_interface[57fce32a49ee6398]::util::run_in_thread_pool_with_globals<rustc_interface[57fce32a49ee6398]::interface::run_compiler<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9fdc13437c3067b0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  44:        0x10e8a52bc - std::sys::pal::unix::thread::Thread::new::thread_start::h538430a11caebc44
  45:        0x18b1bec0c - __pthread_cond_wait

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/Users/kpreid/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glam-0.30.5/rustc-ice-2025-07-29T03_57_24-72327.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=2 -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C debug-assertions=on

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `euler::<impl at /Users/kpreid/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glam-0.30.5/src/euler.rs:404:9: 404:31>::to_euler_angles`
#1 [cross_crate_inlinable] whether the item should be made inlinable across crates
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: could not compile `glam` (lib)

Caused by:
  process didn't exit successfully: `/Users/kpreid/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustc --crate-name glam --edition=2021 /Users/kpreid/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glam-0.30.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=211 --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --warn=unexpected_cfgs --check-cfg 'cfg(target_arch, values("spirv"))' -C debug-assertions=on --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("approx", "bytecheck", "bytemuck", "core-simd", "cuda", "debug-glam-assert", "default", "fast-math", "glam-assert", "libm", "mint", "nostd-libm", "rand", "rkyv", "scalar-math", "serde", "speedy", "std"))' -C metadata=53063e6929dcaebc -C extra-filename=-28fe2bab7d0849f1 --out-dir /Users/kpreid/Projects/rust/scratch/foo/target/debug/deps -L dependency=/Users/kpreid/Projects/rust/scratch/foo/target/debug/deps --cap-lints allow` (exit status: 101)

@rustbot label regression-from-stable-to-nightly

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Jul 29, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jul 29, 2025
  3. jieyouxu commented on Jul 29, 2025

    @jieyouxu
    Member
  4. scottmcm commented on Jul 29, 2025

    @scottmcm
    Member

    Well no need to bisect at least, it's clearly #143833 (cc rust-lang/compiler-team#838) Actually, based on timing, it's not, at least not directly.

    But darn, I thought I'd gotten all these in rust-lang/stdarch#1740

    Crate code: https://docs.rs/glam/0.30.5/src/glam/euler.rs.html#402-414

    I'll try to take a look, though doing so from x64 will probably be annoying. If anyone can isolate to where it should be an easy fix, though.

    EDIT: Oh, fun, it's still using non-array SIMD on some targets (https://docs.rs/glam/0.30.5/src/glam/f32/vec3.rs.html#23) which hasn't worked on nightly in almost a year (#129403).

  5. added
    O-AArch64Armv8-A or later processors in AArch64 mode
    on Jul 29, 2025
  6. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jul 29, 2025
  7. stefanboca commented on Jul 29, 2025

    @stefanboca

    I also ran into this, here's another repro if it helps at all. For me this only errors in release builds; debug still builds fine.

    #![feature(portable_simd)]
    
    use std::simd::Simd;
    
    pub(crate) fn foo(simds: &[Simd<u8, 16>], _unused: Simd<u8, 16>) {
        let a = simds[0];
    }

    The above compiles after removing the _unused argument.

    Meta

    rustc --version --verbose:

    rustc 1.90.0-nightly (498ae9fed 2025-07-28)
    binary: rustc
    commit-hash: 498ae9fed2e7d90821d70a048f3770f91af08957
    commit-date: 2025-07-28
    host: x86_64-unknown-linux-gnu
    release: 1.90.0-nightly
    LLVM version: 20.1.8
    

    Error output

    error: internal compiler error: compiler/rustc_mir_transform/src/validate.rs:80:25: broken MIR in Item(DefId(0:4 ~ playground[d875]::foo)) (after phase change to runtime-optimized) at bb1[0]:
                                    Projecting into SIMD type std::simd::Simd is banned by MCP#838
     --> src/lib.rs:6:13
      |
    6 |     let a = simds[0];
      |             ^^^^^^^^
    
    Backtrace

    thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:80:25:
    Box<dyn Any>
    stack backtrace:
       0:     0x7fea457befb5 - std::backtrace::Backtrace::create::hf91db3f640b5c750
       1:     0x7fea457bef05 - std::backtrace::Backtrace::force_capture::h21cb8315e241075f
       2:     0x7fea44858545 - std[a40869ec86c0be37]::panicking::update_hook::<alloc[6bff5a853f1091a5]::boxed::Box<rustc_driver_impl[1e14af3d6ff318b8]::install_ice_hook::{closure#1}>>::{closure#0}
       3:     0x7fea457d8fce - std::panicking::rust_panic_with_hook::h940eac454294b603
       4:     0x7fea44891841 - std[a40869ec86c0be37]::panicking::begin_panic::<rustc_errors[63d76ee921538c85]::ExplicitBug>::{closure#0}
       5:     0x7fea448867d6 - std[a40869ec86c0be37]::sys::backtrace::__rust_end_short_backtrace::<std[a40869ec86c0be37]::panicking::begin_panic<rustc_errors[63d76ee921538c85]::ExplicitBug>::{closure#0}, !>
       6:     0x7fea44886665 - std[a40869ec86c0be37]::panicking::begin_panic::<rustc_errors[63d76ee921538c85]::ExplicitBug>
       7:     0x7fea4489b2b1 - <rustc_errors[63d76ee921538c85]::diagnostic::BugAbort as rustc_errors[63d76ee921538c85]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
       8:     0x7fea44e0bcdc - <rustc_errors[63d76ee921538c85]::DiagCtxtHandle>::span_bug::<rustc_span[37dba8674e9310c0]::span_encoding::Span, alloc[6bff5a853f1091a5]::string::String>
       9:     0x7fea44ea0b67 - rustc_middle[8189fbb6e8ddda52]::util::bug::opt_span_bug_fmt::<rustc_span[37dba8674e9310c0]::span_encoding::Span>::{closure#0}
      10:     0x7fea44e8005a - rustc_middle[8189fbb6e8ddda52]::ty::context::tls::with_opt::<rustc_middle[8189fbb6e8ddda52]::util::bug::opt_span_bug_fmt<rustc_span[37dba8674e9310c0]::span_encoding::Span>::{closure#0}, !>::{closure#0}
      11:     0x7fea44e7fecb - rustc_middle[8189fbb6e8ddda52]::ty::context::tls::with_context_opt::<rustc_middle[8189fbb6e8ddda52]::ty::context::tls::with_opt<rustc_middle[8189fbb6e8ddda52]::util::bug::opt_span_bug_fmt<rustc_span[37dba8674e9310c0]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
      12:     0x7fea42f57597 - rustc_middle[8189fbb6e8ddda52]::util::bug::span_bug_fmt::<rustc_span[37dba8674e9310c0]::span_encoding::Span>
      13:     0x7fea435992d8 - <rustc_mir_transform[b10d8462625e20cf]::validate::CfgChecker>::fail::<alloc[6bff5a853f1091a5]::string::String>
      14:     0x7fea4730bbd0 - <rustc_mir_transform[b10d8462625e20cf]::validate::Validator as rustc_mir_transform[b10d8462625e20cf]::pass_manager::MirPass>::run_pass
      15:     0x7fea46011836 - rustc_mir_transform[b10d8462625e20cf]::run_optimization_passes
      16:     0x7fea46d28af8 - rustc_mir_transform[b10d8462625e20cf]::optimized_mir
      17:     0x7fea46d282dd - rustc_query_impl[371f4acb5ba9ab34]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[371f4acb5ba9ab34]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8189fbb6e8ddda52]::query::erase::Erased<[u8; 8usize]>>
      18:     0x7fea46018f25 - rustc_query_system[195bfac6b6ef1586]::query::plumbing::try_execute_query::<rustc_query_impl[371f4acb5ba9ab34]::DynamicConfig<rustc_query_system[195bfac6b6ef1586]::query::caches::DefIdCache<rustc_middle[8189fbb6e8ddda52]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[371f4acb5ba9ab34]::plumbing::QueryCtxt, false>
      19:     0x7fea4601841b - rustc_query_impl[371f4acb5ba9ab34]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
      20:     0x7fea43757bfd - rustc_mir_transform[b10d8462625e20cf]::deduce_param_attrs::deduced_param_attrs
      21:     0x7fea4619dc2a - rustc_query_impl[371f4acb5ba9ab34]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[371f4acb5ba9ab34]::query_impl::deduced_param_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[8189fbb6e8ddda52]::query::erase::Erased<[u8; 16usize]>>
      22:     0x7fea4619dc0f - <rustc_query_impl[371f4acb5ba9ab34]::query_impl::deduced_param_attrs::dynamic_query::{closure#2} as core[729d18482630865e]::ops::function::FnOnce<(rustc_middle[8189fbb6e8ddda52]::ty::context::TyCtxt, rustc_span[37dba8674e9310c0]::def_id::DefId)>>::call_once
      23:     0x7fea4619ef7b - rustc_query_system[195bfac6b6ef1586]::query::plumbing::try_execute_query::<rustc_query_impl[371f4acb5ba9ab34]::DynamicConfig<rustc_query_system[195bfac6b6ef1586]::query::caches::DefIdCache<rustc_middle[8189fbb6e8ddda52]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[371f4acb5ba9ab34]::plumbing::QueryCtxt, false>
      24:     0x7fea4619e868 - rustc_query_impl[371f4acb5ba9ab34]::query_impl::deduced_param_attrs::get_query_non_incr::__rust_end_short_backtrace
      25:     0x7fea46b7331a - <rustc_metadata[7bd0cc19634daba3]::rmeta::encoder::EncodeContext>::encode_crate_root
      26:     0x7fea4748fc70 - <rustc_metadata[7bd0cc19634daba3]::rmeta::encoder::encode_metadata::{closure#3} as core[729d18482630865e]::ops::function::FnOnce<(rustc_middle[8189fbb6e8ddda52]::ty::context::TyCtxt, &std[a40869ec86c0be37]::path::Path)>>::call_once
      27:     0x7fea4748ceb0 - rustc_metadata[7bd0cc19634daba3]::rmeta::encoder::encode_metadata
      28:     0x7fea46f1a417 - rustc_metadata[7bd0cc19634daba3]::fs::encode_and_write_metadata
      29:     0x7fea47135c43 - <rustc_interface[f6a0648cee61be4a]::queries::Linker>::codegen_and_build_linker
      30:     0x7fea4713383c - rustc_interface[f6a0648cee61be4a]::passes::create_and_enter_global_ctxt::<core[729d18482630865e]::option::Option<rustc_interface[f6a0648cee61be4a]::queries::Linker>, rustc_driver_impl[1e14af3d6ff318b8]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
      31:     0x7fea472cacde - rustc_interface[f6a0648cee61be4a]::interface::run_compiler::<(), rustc_driver_impl[1e14af3d6ff318b8]::run_compiler::{closure#0}>::{closure#1}
      32:     0x7fea47198141 - std[a40869ec86c0be37]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f6a0648cee61be4a]::util::run_in_thread_with_globals<rustc_interface[f6a0648cee61be4a]::util::run_in_thread_pool_with_globals<rustc_interface[f6a0648cee61be4a]::interface::run_compiler<(), rustc_driver_impl[1e14af3d6ff318b8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
      33:     0x7fea47197e22 - <<std[a40869ec86c0be37]::thread::Builder>::spawn_unchecked_<rustc_interface[f6a0648cee61be4a]::util::run_in_thread_with_globals<rustc_interface[f6a0648cee61be4a]::util::run_in_thread_pool_with_globals<rustc_interface[f6a0648cee61be4a]::interface::run_compiler<(), rustc_driver_impl[1e14af3d6ff318b8]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[729d18482630865e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      34:     0x7fea4719df7d - std::sys::pal::unix::thread::Thread::new::thread_start::hccd3bb61f89c035f
      35:     0x7fea4089af08 - start_thread
      36:     0x7fea409230ac - __clone3
      37:                0x0 - <unknown>
    
    
    rustc version: 1.90.0-nightly (498ae9fed 2025-07-28)
    platform: x86_64-unknown-linux-gnu
    
    query stack during panic:
    #0 [optimized_mir] optimizing MIR for `foo`
    #1 [deduced_param_attrs] deducing parameter attributes for foo
    end of query stack
    

  8. scottmcm commented on Jul 30, 2025

    @scottmcm
    Member

    @stefanboca Thank you! Isolating to not be neon-only and not need an extra crate helps a ton :)

    Repro link: https://play.rust-lang.org/?version=nightly&mode=release&edition=2024&gist=0846e5f86dd52777f25b6bcd13942f7e

    Needs release -- in debug it doesn't trigger.

    Hmm, not triggering in 7-27 https://rust.godbolt.org/z/4W6evss9M, so maybe it's actually #144543 instead. That'd be good -- must easier to fix :)

    Ah, yup. With -Z validate-mir=yes it confirms it's SRoA:

    error: internal compiler error: compiler\rustc_mir_transform\src\validate.rs:80:25: broken MIR in Item(DefId(0:4 ~ uhoh[0d16]::foo)) (after pass ScalarReplacementOfAggregates) at bb1[0]:
                                    Projecting into SIMD type std::simd::Simd is banned by MCP#838
     --> uhoh.rs:6:13
      |
    6 |     let a = simds[0];
      |             ^^^^^^^^
    

    @rustbot claim

  9. compiler-errors commented on Jul 30, 2025

    @compiler-errors
    Contributor

    Yeah, the SRoA pass doesn't know that expanding the fields of SIMD structs is illegal.

  10. added
    A-mir-optArea: MIR optimizations
    and removed
    O-AArch64Armv8-A or later processors in AArch64 mode
    on Jul 30, 2025
  11. scottmcm commented on Jul 30, 2025

    @scottmcm
    Member

    Yeah, the SRoA pass doesn't know that expanding the fields of SIMD structs is illegal.

    It used to have a check; I removed it not realizing that it would expand even if nothing even looks at the fields.

    Anyway, fix is up in #144665

  12. awxkee commented on Jul 30, 2025

    @awxkee
    Contributor

    Also happens on attempts to create a tuple from NEON types.

    float32x4x2_t(vld1q_f32(a), vld1q_f32(a.add(4)))
    
    Stacktrace
     --> src/neon/utils.rs:95:14
       |
    95 |     unsafe { float32x4x2_t(vld1q_f32(a), vld1q_f32(a.add(4))) }
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    
    thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:80:25:
    Box<dyn Any>
    stack backtrace:
       0:        0x10f05cb4c - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h2c8dadb96be3f8dc
       1:        0x10c538670 - core::fmt::write::haea1839b4421f097
       2:        0x10f051184 - std::io::Write::write_fmt::h829d20f6c5614c8f
       3:        0x10f05ca0c - std::sys::backtrace::BacktraceLock::print::h9d16fad313b69287
       4:        0x10f0615c0 - std::panicking::default_hook::{{closure}}::hd647fc9fea98ee68
       5:        0x10f061298 - std::panicking::default_hook::h438fdb7239b92b6b
       6:        0x10d12f1ac - rustc_driver_impl[c764e17e85da8204]::install_ice_hook::{closure#1}
       7:        0x10f061f4c - std::panicking::rust_panic_with_hook::h14f7a21fdd463b8b
       8:        0x10d15f534 - std[b05d56cfd8fca740]::panicking::begin_panic::<rustc_errors[1c7534ae315a5042]::ExplicitBug>::{closure#0}
       9:        0x10d14df40 - std[b05d56cfd8fca740]::sys::backtrace::__rust_end_short_backtrace::<std[b05d56cfd8fca740]::panicking::begin_panic<rustc_errors[1c7534ae315a5042]::ExplicitBug>::{closure#0}, !>
      10:        0x111cff890 - std[b05d56cfd8fca740]::panicking::begin_panic::<rustc_errors[1c7534ae315a5042]::ExplicitBug>
      11:        0x111cffdd0 - <rustc_errors[1c7534ae315a5042]::diagnostic::BugAbort as rustc_errors[1c7534ae315a5042]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
      12:        0x111d6e330 - <rustc_errors[1c7534ae315a5042]::DiagCtxtHandle>::span_bug::<rustc_span[383248f629c63a7f]::span_encoding::Span, alloc[e2705810b410854d]::string::String>
      13:        0x111d77208 - rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt::<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}
      14:        0x10ddd951c - rustc_middle[ff00f450670e31a2]::ty::context::tls::with_opt::<rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}, !>::{closure#0}
      15:        0x10ddd8fe4 - rustc_middle[ff00f450670e31a2]::ty::context::tls::with_context_opt::<rustc_middle[ff00f450670e31a2]::ty::context::tls::with_opt<rustc_middle[ff00f450670e31a2]::util::bug::opt_span_bug_fmt<rustc_span[383248f629c63a7f]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
      16:        0x111d77178 - rustc_middle[ff00f450670e31a2]::util::bug::span_bug_fmt::<rustc_span[383248f629c63a7f]::span_encoding::Span>
      17:        0x10e166a08 - <rustc_mir_transform[c3f80c3e19acb41d]::validate::CfgChecker>::fail::<alloc[e2705810b410854d]::string::String>
      18:        0x10e165b34 - <rustc_mir_transform[c3f80c3e19acb41d]::validate::Validator as rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::MirPass>::run_pass
      19:        0x10e0b7198 - rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::run_passes_inner
      20:        0x10e0dbf5c - rustc_mir_transform[c3f80c3e19acb41d]::run_optimization_passes
      21:        0x10e0dc3c0 - rustc_mir_transform[c3f80c3e19acb41d]::optimized_mir
      22:        0x10e7ceb50 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>
      23:        0x10e5a78e0 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefIdCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      24:        0x10e7eb5f8 - rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
      25:        0x10de5ddb4 - <rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt>::instance_mir
      26:        0x10e17fcc8 - rustc_mir_transform[c3f80c3e19acb41d]::inline::try_instance_mir
      27:        0x10e13335c - rustc_mir_transform[c3f80c3e19acb41d]::inline::process_blocks::<rustc_mir_transform[c3f80c3e19acb41d]::inline::NormalInliner>
      28:        0x10e12ee4c - <rustc_mir_transform[c3f80c3e19acb41d]::inline::Inline as rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::MirPass>::run_pass
      29:        0x10e0b6dd8 - rustc_mir_transform[c3f80c3e19acb41d]::pass_manager::run_passes_inner
      30:        0x10e0dbf5c - rustc_mir_transform[c3f80c3e19acb41d]::run_optimization_passes
      31:        0x10e0dc3c0 - rustc_mir_transform[c3f80c3e19acb41d]::optimized_mir
      32:        0x10e7ceb50 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>
      33:        0x10e5a78e0 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefIdCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      34:        0x10e7eb5f8 - rustc_query_impl[710479fe5bc1800b]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
      35:        0x10de5ddb4 - <rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt>::instance_mir
      36:        0x10e1c09b4 - rustc_monomorphize[9a167c8c433c79ac]::mono_checks::check_mono_item
      37:        0x10e7cf518 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::check_mono_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 0usize]>>
      38:        0x10e772560 - <rustc_query_impl[710479fe5bc1800b]::query_impl::check_mono_item::dynamic_query::{closure#2} as core[9fdc13437c3067b0]::ops::function::FnOnce<(rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt, rustc_middle[ff00f450670e31a2]::ty::instance::Instance)>>::call_once
      39:        0x10e5f77fc - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefaultCache<rustc_middle[ff00f450670e31a2]::ty::instance::Instance, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      40:        0x10e864e58 - rustc_query_impl[710479fe5bc1800b]::query_impl::check_mono_item::get_query_non_incr::__rust_end_short_backtrace
      41:        0x10e1be26c - rustc_monomorphize[9a167c8c433c79ac]::collector::items_of_instance
      42:        0x10e7d086c - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::items_of_instance::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 32usize]>>
      43:        0x10e77e780 - <rustc_query_impl[710479fe5bc1800b]::query_impl::items_of_instance::dynamic_query::{closure#2} as core[9fdc13437c3067b0]::ops::function::FnOnce<(rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt, (rustc_middle[ff00f450670e31a2]::ty::instance::Instance, rustc_middle[ff00f450670e31a2]::mir::mono::CollectionMode))>>::call_once
      44:        0x10e6198d0 - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::DefaultCache<(rustc_middle[ff00f450670e31a2]::ty::instance::Instance, rustc_middle[ff00f450670e31a2]::mir::mono::CollectionMode), rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 32usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      45:        0x10e866708 - rustc_query_impl[710479fe5bc1800b]::query_impl::items_of_instance::get_query_non_incr::__rust_end_short_backtrace
      46:        0x10e1d2d64 - rustc_monomorphize[9a167c8c433c79ac]::collector::collect_items_rec::{closure#0}
      47:        0x10e1d0eb8 - rustc_monomorphize[9a167c8c433c79ac]::collector::collect_items_rec
      48:        0x10e1d215c - rustc_monomorphize[9a167c8c433c79ac]::collector::collect_items_rec
      49:        0x10e1d756c - rustc_monomorphize[9a167c8c433c79ac]::collector::collect_crate_mono_items::{closure#1}::{closure#0}
      50:        0x10e1cbf64 - rustc_monomorphize[9a167c8c433c79ac]::partitioning::collect_and_partition_mono_items
      51:        0x10e7d3b88 - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 40usize]>>
      52:        0x10e5b179c - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_query_system[8d269a2fdd66b5b0]::query::caches::SingleCache<rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 40usize]>>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      53:        0x10e8439fc - rustc_query_impl[710479fe5bc1800b]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
      54:        0x10cf1f988 - rustc_codegen_ssa[6ee4371cd9804e88]::back::symbol_export::exported_generic_symbols_provider_local
      55:        0x10e7d2f7c - rustc_query_impl[710479fe5bc1800b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[710479fe5bc1800b]::query_impl::exported_generic_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 16usize]>>
      56:        0x10e61efec - rustc_query_system[8d269a2fdd66b5b0]::query::plumbing::try_execute_query::<rustc_query_impl[710479fe5bc1800b]::DynamicConfig<rustc_data_structures[7d85fa12d06a6e]::vec_cache::VecCache<rustc_span[383248f629c63a7f]::def_id::LocalDefId, rustc_middle[ff00f450670e31a2]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[8d269a2fdd66b5b0]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[710479fe5bc1800b]::plumbing::QueryCtxt, false>
      57:        0x10e84354c - rustc_query_impl[710479fe5bc1800b]::query_impl::exported_generic_symbols::get_query_non_incr::__rust_end_short_backtrace
      58:        0x10dc63358 - <rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::EncodeContext>::encode_crate_root
      59:        0x111d58df4 - rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata::{closure#3}::{closure#0}
      60:        0x10dc3bf10 - <rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata::{closure#3} as core[9fdc13437c3067b0]::ops::function::FnOnce<(rustc_middle[ff00f450670e31a2]::ty::context::TyCtxt, &std[b05d56cfd8fca740]::path::Path)>>::call_once
      61:        0x10dcc39e0 - rustc_metadata[7a8e59b443ce0166]::rmeta::encoder::encode_metadata
      62:        0x10dc8a17c - rustc_metadata[7a8e59b443ce0166]::fs::encode_and_write_metadata
      63:        0x10da19450 - <rustc_interface[57fce32a49ee6398]::queries::Linker>::codegen_and_build_linker
      64:        0x10d098060 - rustc_interface[57fce32a49ee6398]::passes::create_and_enter_global_ctxt::<core[9fdc13437c3067b0]::option::Option<rustc_interface[57fce32a49ee6398]::queries::Linker>, rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}::{closure#2}>
      65:        0x10d0dfd88 - rustc_interface[57fce32a49ee6398]::interface::run_compiler::<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}
      66:        0x10d0d51f4 - std[b05d56cfd8fca740]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[57fce32a49ee6398]::util::run_in_thread_with_globals<rustc_interface[57fce32a49ee6398]::util::run_in_thread_pool_with_globals<rustc_interface[57fce32a49ee6398]::interface::run_compiler<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
      67:        0x10d0e20c4 - <<std[b05d56cfd8fca740]::thread::Builder>::spawn_unchecked_<rustc_interface[57fce32a49ee6398]::util::run_in_thread_with_globals<rustc_interface[57fce32a49ee6398]::util::run_in_thread_pool_with_globals<rustc_interface[57fce32a49ee6398]::interface::run_compiler<(), rustc_driver_impl[c764e17e85da8204]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[9fdc13437c3067b0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
      68:        0x10f0652bc - std::sys::pal::unix::thread::Thread::new::thread_start::h538430a11caebc44
      69:        0x19c05af94 - __pthread_joiner_wake
    
    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
    
    

    CI link

  13. marked Unknown Glam SIMD issue #144710 as a duplicate of this issue on Jul 31, 2025
  14. added a commit that references this issue on Jul 31, 2025
    8cca6bc
  15. added a commit that references this issue on Jul 31, 2025
    eed7cb8
  16. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 4, 2025
  17. added a commit that references this issue on Dec 21, 2025
    d8da83c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions