Unsized return types are allowed on trait associated function declarations #109270
Labels
A-type-system
Area: Type system
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expect the line marked with "Ok" to cause compilation error, because the return type is unsized.
It's better to produce diagnostics early, without waiting until somebody tries to implement this trait (which would be impossible anyway).
Instead, this happens: the compiler allows to declare the associated function
f()
, and only complains when I try to implement it for a concrete type.I did a quick search in the issue tracker and it looks like it's maybe similar to #82633.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: