-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
The Output should not be an association type of the FnOnce #108490
Comments
...But what exactly would we gain by making this change? |
Make it a legal statement:
And don't need to be like this:
|
The invalid bound |
I have to admit that I am a bad example, I mean, |
I can say clear, this is wrong, the life cycle of designated by the caller is exist and reasonable. One example is:
Although it doesn't seem to make much sense, what about self-referencing life cycle?
|
This appears to be a breaking change: https://internals.rust-lang.org/t/reopen-fnonce-why-is-output-an-associated-type/18430/8?u=jyn514 Given that, it doesn't seem strongly enough motivated to be worth changing. |
Currently, we require that the lifecycle that appears in an association type appear in a generic type.
This is to fix #32330 .
But this because the
Output
is an associative type of the function.Except for functions, no same type can implement different lifecycle
Output
.So the
Output
as an association type is just an error.See #33685 (comment)
The text was updated successfully, but these errors were encountered: