-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Port and Chan methods should take &mut self #5372
Comments
As far as I am aware, it is currently not possible for a closure to capture a mutable. So a closure could never obtain a mutable reference to a Chan or Port, which means it would never be able to call, for example, channel.send(&mut self, x). Of course there are tricks such as transmute_mut, but perhaps it would be better for this issue to remain unfixed until closures can capture mutable references. |
I'm still not totally sure I think this is a good idea. There are some types, like |
Nominating backward compat |
already on the backwards-compatible milestone |
Even if ports/chans had |
Tagging as an RFC to get some more input here. It's not a design choice isolated to these types. |
the mutable capture problem will be solved en passant with once closures or with macro-trait closures. basically we just have to wait until the dust settles on the ultimate fate of closures, and then make the change here. |
cc me |
Closing, it was decided by #10830 that they shouldn't. |
move redundant_pub_crate to nursery cc rust-lang#5369 changelog: none
* add doc_comment_code_block_width configuration * updated config docu * Updated docu and changed tests to config folder
As well as other functions and methods on pipes. They are mutating the pipe.
The text was updated successfully, but these errors were encountered: