-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove proc
from the language
#19338
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
Remove proc
from the language
#19338
Conversation
This is awesome! I was afraid |
ab70f27
to
491d3ed
Compare
@nikomatsakis could you make sure that at least one of the commits if flagged as a breaking-change along with some clear documentation of how to migrate? It would also be nice to expand a bit on migration path for the consuming side you alluded to in the description. |
I added some comments to a previous set of commits, and my high level comments were:
Other than that, and the comments in the previous commits, r=me, thanks so much @nikomatsakis! |
The `spawn` function has the type signature: `fn | ||
spawn<F:FnOnce()+Send>(f: F)`. This indicates that it takes as | ||
argument a closure (of type `F`) that it will run exactly once. This | ||
closure is limited to capturing `Send`-able data form its environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/form/from
proc
types from the languageproc
from the language
Blog post explaining the high-level details: http://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/ |
@alexcrichton the breaking change annotation is in the PR header, and I included a link to my blog post. I believe that shows up in the merge commit, right? |
cc me |
7f34f06
to
79ba682
Compare
d8405fa
to
d51d810
Compare
d51d810
to
a6b5350
Compare
…, r=alexcrichton This PR lets `rustc` generate debuginfo for variables captured by unboxed closures. Fixes #19356 @nikomatsakis This PR will probably conflict with #19338. If this gets merged before, you should be able to just leave the test case as it is (maybe remove the `#![feature(unboxed_closures)]` directive).
Status: semi-blocked on #19438 |
c876e97
to
e2e8768
Compare
boxed `FnOnce` closures.
…ethod. Besides being yucky, it will cause problems if we try to make all traits implement themselves, which would make a lot of things in life easier. Also, it was inextricably linked to `Box`, which was not the intention. We can work around its absence, so better to reimplement it later in a more thorough fashion.
with the fn traits
language. Recommend `move||` instead.
to prevent such oversights in the future.
duplicate tests around object types.
cc @steveklabnick
7059ad8
to
f6d60f3
Compare
…oc, r=acrichto They are replaced with unboxed closures. cc @pcwalton @aturon This is a [breaking-change]. Mostly, uses of `proc()` simply need to be converted to `move||` (unboxed closures), but in some cases the adaptations required are more complex (particularly for library authors). A detailed write-up can be found here: http://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/ The commits are ordered to emphasize the more important changes, but are not truly standalone.
'proc' is a very useful keyword to have, particularly when one is writing an operating system. I suggest that it should no longer be a reserved word given that it no longer has semantic meaning. |
@zesterer I agree. Care to open a PR? I think all you have to do is to remove this line: rust/src/libsyntax_pos/symbol.rs Line 317 in a04b88d
If you do, add |
I've never opened a Rust PR before. Have you any advice on how best to word things? |
I would...
|
They are replaced with unboxed closures.
cc @pcwalton @aturon
This is a [breaking-change]. Mostly, uses of
proc()
simply need to be converted tomove||
(unboxed closures), but in some cases the adaptations required are more complex (particularly for library authors). A detailed write-up can be found here: http://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/The commits are ordered to emphasize the more important changes, but are not truly standalone.