-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Wrap<T>: Sized should imply T: Sized #146670
Copy link
Copy link
Open
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.needs-fcpThis change is insta-stable, or significant enough to need a team FCP to proceed.This change is insta-stable, or significant enough to need a team FCP to proceed.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.needs-fcpThis change is insta-stable, or significant enough to need a team FCP to proceed.This change is insta-stable, or significant enough to need a team FCP to proceed.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected the code to compile. Instead, I got the following error:
It seems that, to the compiler,
Wrap<T>: Sizeddoes not implyT: Sized.I think that making the compiler do this inference won't cause semver problems, since Sized is a fundamental trait, so changing whether a type implements Sized is already a breaking change.
(Additional context: I was trying to implement a trait for this wrapper type. The trait has a method with a
where Self: Sizedbound. I ran into this issue while trying to implement this method.)Meta
Reproducible on the playground with version
1.92.0-nightly (2025-09-16 a9d0a6f15533a364816c)