-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Maybe-sized RPIT type is unexpectedly allowed in async fn #149438
Copy link
Copy link
Open
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.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.
Metadata
Metadata
Assignees
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code: playground
I expected to see this happen: return types must always be sized, so
-> impl Debug + ?Sizedis not valid for any function regardless if it'sasyncor not.Instead, this happened: the compiler unexpectedly accepts it for
asyncfunctions.Meta
rustc --version --verbose:Also happens on the 2025-11-27 nightly on the playground.