diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-18 21:15:42 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-19 12:40:19 -0800 |
| commit | 1946265e1a1a32eb922846f314657a4aa7eb1d23 (patch) | |
| tree | 4b83f81bf1b265933a13605d9d35eab67a34ea8d /src/libstd/unstable/sync.rs | |
| parent | eef913b290f668b4f131ead5be65a1615616426b (diff) | |
| download | rust-1946265e1a1a32eb922846f314657a4aa7eb1d23.tar.gz rust-1946265e1a1a32eb922846f314657a4aa7eb1d23.zip | |
libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstd
Diffstat (limited to 'src/libstd/unstable/sync.rs')
| -rw-r--r-- | src/libstd/unstable/sync.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs index 3423b995fda..ae4b5d4c6aa 100644 --- a/src/libstd/unstable/sync.rs +++ b/src/libstd/unstable/sync.rs @@ -296,7 +296,7 @@ impl<T> Drop for UnsafeArc<T>{ * synchronization whatsoever. It only makes sense to use for CPU-local issues. */ // FIXME(#8140) should not be pub -pub unsafe fn atomically<U>(f: &fn() -> U) -> U { +pub unsafe fn atomically<U>(f: || -> U) -> U { use rt::task::{Task, GreenTask, SchedTask}; use rt::local::Local; @@ -340,7 +340,7 @@ impl LittleLock { } } - pub unsafe fn lock<T>(&self, f: &fn() -> T) -> T { + pub unsafe fn lock<T>(&self, f: || -> T) -> T { let this = cast::transmute_mut(self); do atomically { this.l.lock(); @@ -352,7 +352,7 @@ impl LittleLock { } } - pub unsafe fn try_lock<T>(&self, f: &fn() -> T) -> Option<T> { + pub unsafe fn try_lock<T>(&self, f: || -> T) -> Option<T> { let this = cast::transmute_mut(self); do atomically { if this.l.trylock() { @@ -372,7 +372,7 @@ impl LittleLock { this.l.signal(); } - pub unsafe fn lock_and_wait(&self, f: &fn() -> bool) { + pub unsafe fn lock_and_wait(&self, f: || -> bool) { let this = cast::transmute_mut(self); do atomically { this.l.lock(); @@ -433,7 +433,7 @@ impl<T:Send> Exclusive<T> { // accessing the provided condition variable) are prohibited while inside // the Exclusive. Supporting that is a work in progress. #[inline] - pub unsafe fn with<U>(&self, f: &fn(x: &mut T) -> U) -> U { + pub unsafe fn with<U>(&self, f: |x: &mut T| -> U) -> U { let rec = self.x.get(); do (*rec).lock.lock { if (*rec).failed { @@ -447,14 +447,14 @@ impl<T:Send> Exclusive<T> { } #[inline] - pub unsafe fn with_imm<U>(&self, f: &fn(x: &T) -> U) -> U { + pub unsafe fn with_imm<U>(&self, f: |x: &T| -> U) -> U { do self.with |x| { f(cast::transmute_immut(x)) } } #[inline] - pub unsafe fn hold_and_signal(&self, f: &fn(x: &mut T)) { + pub unsafe fn hold_and_signal(&self, f: |x: &mut T|) { let rec = self.x.get(); do (*rec).lock.lock { if (*rec).failed { @@ -468,7 +468,7 @@ impl<T:Send> Exclusive<T> { } #[inline] - pub unsafe fn hold_and_wait(&self, f: &fn(x: &T) -> bool) { + pub unsafe fn hold_and_wait(&self, f: |x: &T| -> bool) { let rec = self.x.get(); do (*rec).lock.lock_and_wait { if (*rec).failed { |
