-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
We don't perform sized elaboration for impl-Trait-in-bindings (trait ascription) #144135
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_bindings`#![feature(impl_trait_in_bindings)]``#![feature(impl_trait_in_bindings)]`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.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-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_bindings`#![feature(impl_trait_in_bindings)]``#![feature(impl_trait_in_bindings)]`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.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 expected
impl …-in-binding to get elaborated toimpl Sized + …unless…contains?Sizedbecause that's what we do for all other kinds of impl-Trait (APIT, RPIT(IT), TAIT, ATPIT). However, we don't seem to do that right now.I expected the code below to fail but it compiled successfully:
The
&impl std::fmt::Debugabove should actually elaborate to&(impl std::fmt::Debug + Sized)and therefore the code should fail due to an unfulfilled[u8]: Sizedobligation/goal.As in other places, users need to actually write
&(impl std::fmt::Debug + ?Sized)if they want the code above to work like on master.