about summary refs log tree commit diff
path: root/src/libstd/thread_local
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-12-14 11:37:27 +0000
committerbors <bors@rust-lang.org>2014-12-14 11:37:27 +0000
commit52f7a4a351646d3837f214b5c7aec390c9b08221 (patch)
treef1d12edf0aa7adbb96bf09ea6cc56411898c949c /src/libstd/thread_local
parent3a9305ce823df267fb1afcce76ef06ca09e407ff (diff)
parentf6d60f32080314f1167dd3efb13d772528f500f0 (diff)
auto merge of #19338 : nikomatsakis/rust/unboxed-closure-purge-the-proc, 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.
Diffstat (limited to 'src/libstd/thread_local')
-rw-r--r--src/libstd/thread_local/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index b85b6eccb77..2d5766c2393 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -77,7 +77,7 @@ pub mod scoped;
 /// });
 ///
 /// // each thread starts out with the initial value of 1
-/// spawn(proc() {
+/// spawn(move|| {
 ///     FOO.with(|f| {
 ///         assert_eq!(*f.borrow(), 1);
 ///         *f.borrow_mut() = 3;
@@ -471,7 +471,7 @@ mod tests {
             *f.get() = 2;
         });
         let (tx, rx) = channel();
-        spawn(proc() {
+        spawn(move|| {
             FOO.with(|f| unsafe {
                 assert_eq!(*f.get(), 1);
             });
@@ -491,7 +491,7 @@ mod tests {
         })
 
         let (tx, rx) = channel();
-        spawn(proc() unsafe {
+        spawn(move|| unsafe {
             let mut tx = Some(tx);
             FOO.with(|f| {
                 *f.get() = Some(Foo(tx.take().unwrap()));
@@ -539,7 +539,7 @@ mod tests {
             }
         }
 
-        Thread::start(proc() {
+        Thread::start(move|| {
             drop(S1);
         }).join();
     }
@@ -557,7 +557,7 @@ mod tests {
             }
         }
 
-        Thread::start(proc() unsafe {
+        Thread::start(move|| unsafe {
             K1.with(|s| *s.get() = Some(S1));
         }).join();
     }
@@ -584,7 +584,7 @@ mod tests {
         }
 
         let (tx, rx) = channel();
-        spawn(proc() unsafe {
+        spawn(move|| unsafe {
             let mut tx = Some(tx);
             K1.with(|s| *s.get() = Some(S1(tx.take().unwrap())));
         });