-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
split &fn into &fn and &mut fn #8633
Comments
Nominating for the backwards compatible milestone. |
Current plan, I believe, is roughly what I described here: http://smallcultfollowing.com/babysteps/blog/2013/05/30/removing-procs/. In this case, the only remaining closure type would be |
This won't actually work as is (discussed in the linked bug) so I'm just closing it for now. |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Apr 7, 2022
…arth Escape `mod.rs` file mentions to avoid links in our documentation As the title says nothing special, still a fun fix :) Closes: rust-lang#8627 changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An
&fn
would be copyable, because the environment would be immutable. The limitations would match the ones placed on regular borrowed pointers (&mut
is moveable,&
is immutable) so I think it would result in a more intuitive system.This would be required to make #8622 (adding dynamically sized bare function objects) backwards compatible but can be implemented independently and will not be an enormous task. All existing
&fn
would become&mut fn
and it will remain the default since&mut
coerces to&
by-move.The text was updated successfully, but these errors were encountered: