Closed
Description
In particular, we can write:
struct A<T>(T);
impl A<bool> {
const B: A<u8> = Self(0); // OK but shouldn't be?
const C: A<u8> = Self { 0: 0 }; // Correctly rejected.
}
This can lead to the following interesting situation:
struct A<T>(T);
impl A<bool> {
const B: Self = Self(0); // Rejected, so `Self(..)` is not of type `Self`?
}
cc @petrochenkov, @varkor, @eddyb, and @alexreg
This does seem like a bug to me... In particular, type_alias_enum_variants
does not allow Self::Some(transform(x))
where Self == Option<T>
but where Option<U>
is expected.
cc @rust-lang/lang