-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow trait methods to return impl Trait
types.
#65481
Comments
Please refer to https://github.com/rust-lang/rfcs/blob/master/text/1522-conservative-impl-trait.md#limitation-to-freeinherent-functions for why this isn't allowed. Doing this requires substantial language design efforts and an RFC, so closing in favor of that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It should be possible for methods in traits to have a return value specified as
impl Trait
. This would allow traits to return values without having to specify the exact type or wrap in indirection.This would obviously not be object-safe as the size of the return value would not be known.
The text was updated successfully, but these errors were encountered: