-
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
Regression in associated type checking for default impls #73818
Comments
Another MVCE (playground): #![feature(specialization)]
#[derive(PartialEq)]
enum Never {}
trait Foo {
type Assoc: PartialEq;
}
impl<T> Foo for T {
default type Assoc = Never;
} |
cc @matthewjasper, as far as I can tell this wasn't an intended outcome of the change? |
It wasn't really, it was just slightly more complex to have this still work after that PR. |
@matthewjasper Would you mind describing at a high level what needs to be done? |
It looks like the problem stems from the bound predicate not being fully normalized when checking the defaulted associated type. From my reproducer above:
which should instead be I'm not certain yet how this ought to be implemented. Perhaps a pass after normalization that looks for occurrences of the defaulted type ( |
So I had a trait system in my (nightly) code for a while now that utilized specialization, but it no longer seems to be working after a recent update:
Now, I haven't been following the development of the specialization feature too closely, so it is possible that this is somehow actually intended and I am missing something. However, given that this previously compiled and ran just fine a couple weeks ago and given that the specialization incomplete warning was only added recently, I am inclined to think that it is probably a regression of some sort.
Meta things
compiler version:
The text was updated successfully, but these errors were encountered: