Description
In a freshly created bin, cargo build --release with the only dependency in Cargo.toml being nalgebra="0.24.1" gives a panic in rustc.
I am using rustc 1.65.0-nightly (060e47f 2022-08-23) running on x86_64-unknown-linux-gnu
I expected to see this happen: code compiles successfully
Instead, this happened: compiler panics with ICE:
cargo build --release
Updating crates.io index
Compiling autocfg v1.1.0
Compiling libm v0.2.5
Compiling libc v0.2.132
Compiling getrandom v0.1.16
Compiling cfg-if v1.0.0
Compiling typenum v1.15.0
Compiling ppv-lite86 v0.2.16
Compiling version_check v0.9.4
Compiling rawpointer v0.2.1
Compiling paste v1.0.8
Compiling matrixmultiply v0.2.4
Compiling num-traits v0.2.15
Compiling num-integer v0.1.45
Compiling num-rational v0.3.2
Compiling generic-array v0.14.6
Compiling rand_core v0.5.1
Compiling rand_chacha v0.2.2
Compiling rand v0.7.3
Compiling approx v0.4.0
Compiling num-complex v0.3.1
Compiling rand_distr v0.3.0
Compiling simba v0.3.1
Compiling nalgebra v0.24.1
error: internal compiler error: no errors encountered even though delay_span_bug
issued
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:22528 ~ nalgebra[3ccc]::geometry::quaternion_ops::{impl#40}::mul), const_param_did: None }) (end of phase transition to Optimized) at bb6[22]:
Field projection `(*_25).field[0]` specified type `base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, base::array_storage::ArrayStorage<N, base::dimension::U4, base::dimension::U1>>`, but actual type is base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, <base::default_allocator::DefaultAllocator as base::allocator::Allocator<N, base::dimension::U4>>::Buffer>
--> /home/ahogan/.cargo/registry/src/github.colasdn.workers.dev-1ecc6299db9ec823/nalgebra-0.24.1/src/geometry/quaternion.rs:186:9
|
186 | self.coords[3]
| ^^^^^^^^^^^
|
::: /home/ahogan/.cargo/registry/src/github.colasdn.workers.dev-1ecc6299db9ec823/nalgebra-0.24.1/src/geometry/quaternion_ops.rs:388:13
|
388 | t * self.as_ref().scalar() + cross + rhs
| ---------------------- in this inlined function call
|
= note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:129:36
MANY LINES LIKE ABOVE REPEATED
thread 'rustc' panicked at 'Box', compiler/rustc_errors/src/lib.rs:1487:13
stack backtrace:
0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
1: std::panic::panic_any::<rustc_errors::ExplicitBug>
2: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
3: core::ptr::drop_in_place::<rustc_session::parse::ParseSess>
4: <alloc::rc::Rc<rustc_session::session::Session> as core::ops::drop::Drop>::drop
5: core::ptr::drop_in_place::<rustc_interface::interface::Compiler>
6: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
7: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
8: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
note: 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: rustc 1.65.0-nightly (060e47f 2022-08-23) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: could not compile nalgebra