diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-09-07 14:50:47 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-07 16:12:15 -0700 |
| commit | f0eae8f1c19a051ab750383e479f979c32d4598a (patch) | |
| tree | f4ac6cb0637579d32aeb3dc7d9174dc5a6b3efce /src/libstd | |
| parent | 3078830934ba5596e7eac86825636b49451e40e3 (diff) | |
| download | rust-f0eae8f1c19a051ab750383e479f979c32d4598a.tar.gz rust-f0eae8f1c19a051ab750383e479f979c32d4598a.zip | |
Convert field terminators to commas. Stop parsing semis.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/arc.rs | 16 | ||||
| -rw-r--r-- | src/libstd/arena.rs | 6 | ||||
| -rw-r--r-- | src/libstd/cell.rs | 2 | ||||
| -rw-r--r-- | src/libstd/comm.rs | 4 | ||||
| -rw-r--r-- | src/libstd/map.rs | 16 | ||||
| -rw-r--r-- | src/libstd/sync.rs | 42 |
6 files changed, 43 insertions, 43 deletions
diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index d8c32a26434..b5af4af06c3 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -19,7 +19,7 @@ export RWARC, rw_arc_with_condvars, RWWriteMode, RWReadMode; export unwrap_rw_arc; /// As sync::condvar, a mechanism for unlock-and-descheduling and signalling. -struct Condvar { is_mutex: bool; failed: &mut bool; cond: &sync::Condvar; } +struct Condvar { is_mutex: bool, failed: &mut bool, cond: &sync::Condvar } impl &Condvar { /// Atomically exit the associated ARC and block until a signal is sent. @@ -69,7 +69,7 @@ impl &Condvar { ****************************************************************************/ /// An atomically reference counted wrapper for shared immutable state. -struct ARC<T: const send> { x: SharedMutableState<T>; } +struct ARC<T: const send> { x: SharedMutableState<T> } /// Create an atomically reference counted wrapper. fn ARC<T: const send>(+data: T) -> ARC<T> { @@ -114,9 +114,9 @@ fn unwrap<T: const send>(+rc: ARC<T>) -> T { ****************************************************************************/ #[doc(hidden)] -struct MutexARCInner<T: send> { lock: Mutex; failed: bool; data: T; } +struct MutexARCInner<T: send> { lock: Mutex, failed: bool, data: T } /// An ARC with mutable data protected by a blocking mutex. -struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>>; } +struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>> } /// Create a mutex-protected ARC with the supplied data. fn MutexARC<T: send>(+user_data: T) -> MutexARC<T> { @@ -222,7 +222,7 @@ fn check_poison(is_mutex: bool, failed: bool) { #[doc(hidden)] struct PoisonOnFail { - failed: &mut bool; + failed: &mut bool, drop { /* assert !*self.failed; -- might be false in case of cond.wait() */ if task::failing() { *self.failed = true; } @@ -240,7 +240,7 @@ fn PoisonOnFail(failed: &r/mut bool) -> PoisonOnFail/&r { ****************************************************************************/ #[doc(hidden)] -struct RWARCInner<T: const send> { lock: RWlock; failed: bool; data: T; } +struct RWARCInner<T: const send> { lock: RWlock, failed: bool, data: T } /** * A dual-mode ARC protected by a reader-writer lock. The data can be accessed * mutably or immutably, and immutably-accessing tasks may run concurrently. @@ -248,8 +248,8 @@ struct RWARCInner<T: const send> { lock: RWlock; failed: bool; data: T; } * Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested. */ struct RWARC<T: const send> { - x: SharedMutableState<RWARCInner<T>>; - mut cant_nest: (); + x: SharedMutableState<RWARCInner<T>>, + mut cant_nest: () } /// Create a reader/writer ARC with the supplied data. diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index b59ec38b352..a9010759ef9 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -51,9 +51,9 @@ struct Arena { // The head is seperated out from the list as a unbenchmarked // microoptimization, to avoid needing to case on the list to // access the head. - priv mut head: Chunk; - priv mut pod_head: Chunk; - priv mut chunks: @List<Chunk>; + priv mut head: Chunk, + priv mut pod_head: Chunk, + priv mut chunks: @List<Chunk>, drop { unsafe { destroy_chunk(self.head); diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 2325b0e092e..e67be74c642 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -5,7 +5,7 @@ /// Similar to a mutable option type, but friendlier. struct Cell<T> { - mut value: Option<T>; + mut value: Option<T> } /// Creates a new full cell with the given value. diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index b9934e425b9..d286b496923 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -14,8 +14,8 @@ export DuplexStream; /// An extension of `pipes::stream` that allows both sending and receiving. struct DuplexStream<T: send, U: send> : Channel<T>, Recv<U>, Selectable { - priv chan: Chan<T>; - priv port: Port <U>; + priv chan: Chan<T>, + priv port: Port <U>, fn send(+x: T) { self.chan.send(x) diff --git a/src/libstd/map.rs b/src/libstd/map.rs index c7eba5bb8eb..3db1c3407df 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -113,17 +113,17 @@ mod chained { const initial_capacity: uint = 32u; // 2^5 struct entry<K, V> { - hash: uint; - key: K; - value: V; - mut next: Option<@entry<K, V>>; + hash: uint, + key: K, + value: V, + mut next: Option<@entry<K, V>> } struct hashmap_<K, V> { - mut count: uint; - mut chains: ~[mut Option<@entry<K,V>>]; - hasher: hashfn<K>; - eqer: eqfn<K>; + mut count: uint, + mut chains: ~[mut Option<@entry<K,V>>], + hasher: hashfn<K>, + eqer: eqfn<K> } type t<K, V> = @hashmap_<K, V>; diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 264bd45a130..45ab8d4c427 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -24,8 +24,8 @@ type WaitEnd = pipes::PortOne<()>; type SignalEnd = pipes::ChanOne<()>; // A doubly-ended queue of waiting tasks. #[doc(hidden)] -struct Waitqueue { head: pipes::Port<SignalEnd>; - tail: pipes::Chan<SignalEnd>; } +struct Waitqueue { head: pipes::Port<SignalEnd>, + tail: pipes::Chan<SignalEnd> } fn new_waitqueue() -> Waitqueue { let (block_tail, block_head) = pipes::stream(); @@ -63,11 +63,11 @@ fn broadcast_waitqueue(q: &Waitqueue) -> uint { // The building-block used to make semaphores, mutexes, and rwlocks. #[doc(hidden)] struct SemInner<Q> { - mut count: int; - waiters: Waitqueue; + mut count: int, + waiters: Waitqueue, // Can be either unit or another waitqueue. Some sems shouldn't come with // a condition variable attached, others should. - blocked: Q; + blocked: Q } #[doc(hidden)] enum Sem<Q: send> = Exclusive<SemInner<Q>>; @@ -153,7 +153,7 @@ impl &Sem<~[mut Waitqueue]> { // FIXME(#3136) should go inside of access() #[doc(hidden)] struct SemRelease { - sem: &Sem<()>; + sem: &Sem<()>, drop { self.sem.release(); } } @@ -165,7 +165,7 @@ fn SemRelease(sem: &r/Sem<()>) -> SemRelease/&r { #[doc(hidden)] struct SemAndSignalRelease { - sem: &Sem<~[mut Waitqueue]>; + sem: &Sem<~[mut Waitqueue]>, drop { self.sem.release(); } } @@ -177,7 +177,7 @@ fn SemAndSignalRelease(sem: &r/Sem<~[mut Waitqueue]>) } /// A mechanism for atomic-unlock-and-deschedule blocking and signalling. -struct Condvar { priv sem: &Sem<~[mut Waitqueue]>; drop { } } +struct Condvar { priv sem: &Sem<~[mut Waitqueue]>, drop { } } impl &Condvar { /** @@ -245,7 +245,7 @@ impl &Condvar { // mutex during unwinding. As long as the wrapper (mutex, etc) is // bounded in when it gets released, this shouldn't hang forever. struct SemAndSignalReacquire { - sem: &Sem<~[mut Waitqueue]>; + sem: &Sem<~[mut Waitqueue]>, drop unsafe { // Needs to succeed, instead of itself dying. do task::unkillable { @@ -338,7 +338,7 @@ impl &Sem<~[mut Waitqueue]> { ****************************************************************************/ /// A counting, blocking, bounded-waiting semaphore. -struct Semaphore { priv sem: Sem<()>; } +struct Semaphore { priv sem: Sem<()> } /// Create a new semaphore with the specified count. fn semaphore(count: int) -> Semaphore { @@ -377,7 +377,7 @@ impl &Semaphore { * A task which fails while holding a mutex will unlock the mutex as it * unwinds. */ -struct Mutex { priv sem: Sem<~[mut Waitqueue]>; } +struct Mutex { priv sem: Sem<~[mut Waitqueue]> } /// Create a new mutex, with one associated condvar. fn Mutex() -> Mutex { mutex_with_condvars(1) } @@ -412,8 +412,8 @@ impl &Mutex { #[doc(hidden)] struct RWlockInner { - read_mode: bool; - read_count: uint; + read_mode: bool, + read_count: uint } /** @@ -424,9 +424,9 @@ struct RWlockInner { * unwinds. */ struct RWlock { - /* priv */ order_lock: Semaphore; - /* priv */ access_lock: Sem<~[mut Waitqueue]>; - /* priv */ state: Exclusive<RWlockInner>; + /* priv */ order_lock: Semaphore, + /* priv */ access_lock: Sem<~[mut Waitqueue]>, + /* priv */ state: Exclusive<RWlockInner> } /// Create a new rwlock, with one associated condvar. @@ -584,7 +584,7 @@ impl &RWlock { // FIXME(#3136) should go inside of read() #[doc(hidden)] struct RWlockReleaseRead { - lock: &RWlock; + lock: &RWlock, drop unsafe { do task::unkillable { let mut last_reader = false; @@ -613,7 +613,7 @@ fn RWlockReleaseRead(lock: &r/RWlock) -> RWlockReleaseRead/&r { // FIXME(#3136) should go inside of downgrade() #[doc(hidden)] struct RWlockReleaseDowngrade { - lock: &RWlock; + lock: &RWlock, drop unsafe { do task::unkillable { let mut writer_or_last_reader = false; @@ -647,9 +647,9 @@ fn RWlockReleaseDowngrade(lock: &r/RWlock) -> RWlockReleaseDowngrade/&r { } /// The "write permission" token used for rwlock.write_downgrade(). -struct RWlockWriteMode { /* priv */ lock: &RWlock; drop { } } +struct RWlockWriteMode { /* priv */ lock: &RWlock, drop { } } /// The "read permission" token used for rwlock.write_downgrade(). -struct RWlockReadMode { priv lock: &RWlock; drop { } } +struct RWlockReadMode { priv lock: &RWlock, drop { } } impl &RWlockWriteMode { /// Access the pre-downgrade rwlock in write mode. @@ -956,7 +956,7 @@ mod tests { assert woken == 0; } struct SendOnFailure { - c: pipes::Chan<()>; + c: pipes::Chan<()>, drop { self.c.send(()); } } |
