-
Couldn't load subscription status.
- Fork 13.9k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.