-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE while building nalgebra with mir-opt-level 3: ErrorReported in rustc_mir/src/transform/inline/cycle.rs #82650
Comments
Reduced: use std::marker::PhantomData;
use std::ops::{Add, Mul};
pub trait Allocator<N> {
type Buffer;
}
pub struct DefaultAllocator;
impl<N> Allocator<N> for DefaultAllocator {
type Buffer = ();
}
pub type Owned<N> = <DefaultAllocator as Allocator<N>>::Buffer;
#[derive(Copy, Clone)]
pub struct Matrix<N> {
_phantom: PhantomData<N>,
}
pub type Vector4<N> = Matrix<Owned<N>>;
#[derive(Copy, Clone)]
pub struct Quaternion<N = ()> {
pub coords: Vector4<N>,
}
impl<N> From<Vector4<N>> for Quaternion<N> {
fn from(_coords: Vector4<N>) -> Self {
unimplemented!()
}
}
impl<N> Add for Quaternion<N>
where
DefaultAllocator: Allocator<N>,
{
type Output = Quaternion<N>;
fn add(self, _rhs: Quaternion<N>) -> Self::Output {
Quaternion::from(self.coords)
}
}
pub struct DualQuaternion {
pub real: Quaternion,
pub dual: Quaternion,
}
impl<'a> Mul<()> for &'a DualQuaternion {
type Output = ();
fn mul(self, _rhs: ()) -> () {
let _ = self.real + self.dual;
}
} |
Hm, the reduced code does not reproduce the ice for me. 😕 (wanted to bisect) |
It reproduces on godbolt. |
Ok it works with |
I wanted to find out which commit introduced the ICE but apparently this already happens since several stable releases, I stopped looking after 1.45.2 |
I was not able to reproduce the ICE using the 1.54.0-nightly on the reduced example, even using this.
|
I am getting this instead now on the crate:
|
Fixed by #91743. |
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: