-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Unboxed closure types are implicitly copyable #19817
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Nominating for 1.0 p-backcompat-lang. |
Example test:
This test passes but should not, I think. |
What happens if you actually want the unboxed closure to be copyable? How do you opt-in? Following your example, how do I say: "I want |
With clonable iterators in mind (PR #19837), I wonder if unboxed closures can impl Clone automatically? |
The fix just checks if the bound is `Copy` and returns an `Err` if so. Closes: rust-lang#19817
Like @japaric, I'm also interested in having copyable closures somehow without having to resort to low-level magic. |
I think that closures should implement And if there’s literally no way to get unboxed closures to opt in to |
The fix just checks if the bound is `Copy` and returns an `Err` if so. Closes: rust-lang#19817 @nikomatsakis r?
Closed by #19889 |
Unboxed closure types should be consistent with structs and hence should not by implicitly copyable. They were essentially forgotten by the opt-in copy work.
The text was updated successfully, but these errors were encountered: