-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Self as default type isnt typechecked #61631
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following code compiles:
but shouldn't, because
[Self]is NOT Sized.If we change
[Self]with a[u8], like this:it fails to compile, because
[u8]isnt sized.Also note that if we would write
impl B {}in the case of P being of default type[Self], we get an ICE:Related to #59956 (comment)