Skip to content

Commit edd6d9e

Browse files
committed
convert std::sync types to camelcase
1 parent cf1d2a7 commit edd6d9e

File tree

3 files changed

+137
-135
lines changed

3 files changed

+137
-135
lines changed

src/libstd/arc.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import unsafe::{SharedMutableState, shared_mutable_state,
1010
clone_shared_mutable_state, unwrap_shared_mutable_state,
1111
get_shared_mutable_state, get_shared_immutable_state};
1212
import sync;
13-
import sync::{mutex, mutex_with_condvars, rwlock, rwlock_with_condvars};
13+
import sync::{Mutex, mutex, mutex_with_condvars,
14+
RWlock, rwlock, rwlock_with_condvars};
1415

1516
export arc, clone, get;
1617
export condvar, mutex_arc, mutex_arc_with_condvars, unwrap_mutex_arc;
1718
export rw_arc, rw_arc_with_condvars, rw_write_mode, rw_read_mode;
1819
export unwrap_rw_arc;
1920

2021
/// As sync::condvar, a mechanism for unlock-and-descheduling and signalling.
21-
struct condvar { is_mutex: bool; failed: &mut bool; cond: &sync::condvar; }
22+
struct condvar { is_mutex: bool; failed: &mut bool; cond: &sync::Condvar; }
2223

2324
impl &condvar {
2425
/// Atomically exit the associated ARC and block until a signal is sent.
@@ -113,7 +114,7 @@ fn unwrap<T: const send>(+rc: arc<T>) -> T {
113114
****************************************************************************/
114115

115116
#[doc(hidden)]
116-
struct mutex_arc_inner<T: send> { lock: mutex; failed: bool; data: T; }
117+
struct mutex_arc_inner<T: send> { lock: Mutex; failed: bool; data: T; }
117118
/// An ARC with mutable data protected by a blocking mutex.
118119
struct mutex_arc<T: send> { x: SharedMutableState<mutex_arc_inner<T>>; }
119120

@@ -234,7 +235,7 @@ struct poison_on_fail {
234235
****************************************************************************/
235236
236237
#[doc(hidden)]
237-
struct rw_arc_inner<T: const send> { lock: rwlock; failed: bool; data: T; }
238+
struct rw_arc_inner<T: const send> { lock: RWlock; failed: bool; data: T; }
238239
/**
239240
* A dual-mode ARC protected by a reader-writer lock. The data can be accessed
240241
* mutably or immutably, and immutably-accessing tasks may run concurrently.
@@ -383,17 +384,17 @@ fn unwrap_rw_arc<T: const send>(+arc: rw_arc<T>) -> T {
383384
// lock it. This wraps the unsafety, with the justification that the 'lock'
384385
// field is never overwritten; only 'failed' and 'data'.
385386
#[doc(hidden)]
386-
fn borrow_rwlock<T: const send>(state: &r/mut rw_arc_inner<T>) -> &r/rwlock {
387+
fn borrow_rwlock<T: const send>(state: &r/mut rw_arc_inner<T>) -> &r/RWlock {
387388
unsafe { unsafe::transmute_immut(&mut state.lock) }
388389
}
389390
390391
// FIXME (#3154) ice with struct/&<T> prevents these from being structs.
391392
392393
/// The "write permission" token used for rw_arc.write_downgrade().
393394
enum rw_write_mode<T: const send> =
394-
(&mut T, sync::rwlock_write_mode, poison_on_fail);
395+
(&mut T, sync::RWlockWriteMode, poison_on_fail);
395396
/// The "read permission" token used for rw_arc.write_downgrade().
396-
enum rw_read_mode<T:const send> = (&T, sync::rwlock_read_mode);
397+
enum rw_read_mode<T:const send> = (&T, sync::RWlockReadMode);
397398

398399
impl<T: const send> &rw_write_mode<T> {
399400
/// Access the pre-downgrade rw_arc in write mode.

src/libstd/std.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ mod cell;
5050

5151
// Concurrency
5252

53+
#[warn(non_camel_case_types)]
5354
mod sync;
5455
mod arc;
5556
mod comm;

0 commit comments

Comments
 (0)