-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Specialization ICE - unwrap in #35676
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Here's an example of the ICE https://is.gd/iFtKxe #![feature(specialization)]
fn main() {}
pub trait Alpha<T> { }
pub trait Beta {
type Event;
}
pub trait Delta {
type Handle;
fn process(&self);
}
pub struct Parent<A, T>(A, T);
impl<A, T> Delta for Parent<A, T>
where A: Alpha<T::Handle>,
T: Delta,
T::Handle: Beta<Event = <Handle as Beta>::Event> {
type Handle = Handle;
default fn process(&self) {
unimplemented!()
}
}
impl<A, T> Delta for Parent<A, T>
where A: Alpha<T::Handle> + Alpha<Handle>,
T: Delta,
T::Handle: Beta<Event = <Handle as Beta>::Event> {
fn process(&self) {
unimplemented!()
}
}
pub struct Handle;
impl Beta for Handle {
type Event = ();
} EDIT: reduced further |
I've pinpointed the issue more. If you replace |
Some digging suggests that specialisation graph isn't being created (or being incorrectly created) for /cc @aturon @rust-lang/compiler |
This looks a lot like #33187 which produces the same panic without even using specialization. |
Added A-specialization. |
All examples no longer ICE, they can all be compiled successfully. |
The unwrap in
Graph::parent
here is failing for me.I am unable to reduce my code to a shareably small sample which hits this, but this is a sample of the approximate shape of my code (again, no ICE though) and this is the backtrace:
The text was updated successfully, but these errors were encountered: