std: Camel case some constructors
This commit is contained in:
parent
6c5c835a1d
commit
aab4d6b8d7
src
libstd
rustc
test
bench
compile-fail
arc-rw-cond-shouldnt-escape.rsarc-rw-read-mode-shouldnt-escape.rsarc-rw-state-shouldnt-escape.rsarc-rw-write-mode-cond-shouldnt-escape.rsarc-rw-write-mode-shouldnt-escape.rsno-capture-arc.rsno-reuse-move-arc.rssync-cond-shouldnt-escape.rssync-rwlock-cond-shouldnt-escape.rssync-rwlock-read-mode-shouldnt-escape.rssync-rwlock-write-mode-cond-shouldnt-escape.rssync-rwlock-write-mode-shouldnt-escape.rs
run-pass
@ -10,13 +10,13 @@ import unsafe::{SharedMutableState, shared_mutable_state,
|
||||
clone_shared_mutable_state, unwrap_shared_mutable_state,
|
||||
get_shared_mutable_state, get_shared_immutable_state};
|
||||
import sync;
|
||||
import sync::{Mutex, mutex, mutex_with_condvars,
|
||||
RWlock, rwlock, rwlock_with_condvars};
|
||||
import sync::{Mutex, mutex_with_condvars,
|
||||
RWlock, rwlock_with_condvars};
|
||||
|
||||
export ARC, arc, clone, get;
|
||||
export ARC, clone, get;
|
||||
export Condvar;
|
||||
export MutexARC, mutex_arc, mutex_arc_with_condvars, unwrap_mutex_arc;
|
||||
export RWARC, rw_arc, rw_arc_with_condvars, RWWriteMode, RWReadMode;
|
||||
export MutexARC, mutex_arc_with_condvars, unwrap_mutex_arc;
|
||||
export RWARC, rw_arc_with_condvars, RWWriteMode, RWReadMode;
|
||||
export unwrap_rw_arc;
|
||||
|
||||
/// As sync::condvar, a mechanism for unlock-and-descheduling and signalling.
|
||||
@ -73,7 +73,7 @@ impl &Condvar {
|
||||
struct ARC<T: const send> { x: SharedMutableState<T>; }
|
||||
|
||||
/// Create an atomically reference counted wrapper.
|
||||
fn arc<T: const send>(+data: T) -> ARC<T> {
|
||||
fn ARC<T: const send>(+data: T) -> ARC<T> {
|
||||
ARC { x: unsafe { shared_mutable_state(data) } }
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ struct MutexARCInner<T: send> { lock: Mutex; failed: bool; data: T; }
|
||||
struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>>; }
|
||||
|
||||
/// Create a mutex-protected ARC with the supplied data.
|
||||
fn mutex_arc<T: send>(+user_data: T) -> MutexARC<T> {
|
||||
fn MutexARC<T: send>(+user_data: T) -> MutexARC<T> {
|
||||
mutex_arc_with_condvars(user_data, 1)
|
||||
}
|
||||
/**
|
||||
@ -249,7 +249,7 @@ struct RWARC<T: const send> {
|
||||
}
|
||||
|
||||
/// Create a reader/writer ARC with the supplied data.
|
||||
fn rw_arc<T: const send>(+user_data: T) -> RWARC<T> {
|
||||
fn RWARC<T: const send>(+user_data: T) -> RWARC<T> {
|
||||
rw_arc_with_condvars(user_data, 1)
|
||||
}
|
||||
/**
|
||||
@ -445,7 +445,7 @@ mod tests {
|
||||
#[test]
|
||||
fn manually_share_arc() {
|
||||
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
let arc_v = arc::arc(v);
|
||||
let arc_v = arc::ARC(v);
|
||||
|
||||
let (c, p) = pipes::stream();
|
||||
|
||||
@ -469,7 +469,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_mutex_arc_condvar() {
|
||||
let arc = ~mutex_arc(false);
|
||||
let arc = ~MutexARC(false);
|
||||
let arc2 = ~arc.clone();
|
||||
let (c,p) = pipes::oneshot();
|
||||
let (c,p) = (~mut Some(c), ~mut Some(p));
|
||||
@ -491,7 +491,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_arc_condvar_poison() {
|
||||
let arc = ~mutex_arc(1);
|
||||
let arc = ~MutexARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
let (c,p) = pipes::stream();
|
||||
|
||||
@ -512,7 +512,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_mutex_arc_poison() {
|
||||
let arc = ~mutex_arc(1);
|
||||
let arc = ~MutexARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.access |one| {
|
||||
@ -525,7 +525,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_mutex_arc_unwrap_poison() {
|
||||
let arc = mutex_arc(1);
|
||||
let arc = MutexARC(1);
|
||||
let arc2 = ~(&arc).clone();
|
||||
let (c,p) = pipes::stream();
|
||||
do task::spawn {
|
||||
@ -540,7 +540,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_poison_wr() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.write |one| {
|
||||
@ -553,7 +553,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_poison_ww() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.write |one| {
|
||||
@ -566,7 +566,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_poison_dw() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.write_downgrade |write_mode| {
|
||||
@ -581,7 +581,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_no_poison_rr() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.read |one| {
|
||||
@ -594,7 +594,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_no_poison_rw() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.read |one| {
|
||||
@ -607,7 +607,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[ignore(cfg(windows))]
|
||||
fn test_rw_arc_no_poison_dr() {
|
||||
let arc = ~rw_arc(1);
|
||||
let arc = ~RWARC(1);
|
||||
let arc2 = ~arc.clone();
|
||||
do task::try {
|
||||
do arc2.write_downgrade |write_mode| {
|
||||
@ -623,7 +623,7 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_rw_arc() {
|
||||
let arc = ~rw_arc(0);
|
||||
let arc = ~RWARC(0);
|
||||
let arc2 = ~arc.clone();
|
||||
let (c,p) = pipes::stream();
|
||||
|
||||
@ -662,7 +662,7 @@ mod tests {
|
||||
// (4) tells writer and all other readers to contend as it downgrades.
|
||||
// (5) Writer attempts to set state back to 42, while downgraded task
|
||||
// and all reader tasks assert that it's 31337.
|
||||
let arc = ~rw_arc(0);
|
||||
let arc = ~RWARC(0);
|
||||
|
||||
// Reader tasks
|
||||
let mut reader_convos = ~[];
|
||||
|
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
export CVec;
|
||||
export c_vec, c_vec_with_dtor;
|
||||
export CVec, c_vec_with_dtor;
|
||||
export get, set;
|
||||
export len;
|
||||
export ptr;
|
||||
@ -66,7 +66,7 @@ struct DtorRes {
|
||||
* * base - A foreign pointer to a buffer
|
||||
* * len - The number of elements in the buffer
|
||||
*/
|
||||
unsafe fn c_vec<T>(base: *mut T, len: uint) -> CVec<T> {
|
||||
unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
|
||||
return CVecCtor({
|
||||
base: base,
|
||||
len: len,
|
||||
|
@ -6,7 +6,6 @@
|
||||
import core::Option;
|
||||
import option::{Some, None};
|
||||
|
||||
export doc;
|
||||
export Doc;
|
||||
export doc_at;
|
||||
export maybe_get_doc;
|
||||
@ -75,7 +74,7 @@ fn vuint_at(data: &[u8], start: uint) -> {val: uint, next: uint} {
|
||||
} else { error!("vint too big"); fail; }
|
||||
}
|
||||
|
||||
fn doc(data: @~[u8]) -> Doc {
|
||||
fn Doc(data: @~[u8]) -> Doc {
|
||||
return {data: data, start: 0u, end: vec::len::<u8>(*data)};
|
||||
}
|
||||
|
||||
@ -619,7 +618,7 @@ fn test_option_int() {
|
||||
let mbuf = io::mem_buffer();
|
||||
let ebml_w = ebml::Writer(io::mem_buffer_writer(mbuf));
|
||||
serialize_0(ebml_w, v);
|
||||
let ebml_doc = ebml::doc(@io::mem_buffer_buf(mbuf));
|
||||
let ebml_doc = ebml::Doc(@io::mem_buffer_buf(mbuf));
|
||||
let deser = ebml_deserializer(ebml_doc);
|
||||
let v1 = deserialize_0(deser);
|
||||
debug!("v1 == %?", v1);
|
||||
|
@ -8,8 +8,8 @@
|
||||
* in std.
|
||||
*/
|
||||
|
||||
export Condvar, Semaphore, Mutex, mutex, mutex_with_condvars;
|
||||
export RWlock, rwlock, rwlock_with_condvars, RWlockReadMode, RWlockWriteMode;
|
||||
export Condvar, Semaphore, Mutex, mutex_with_condvars;
|
||||
export RWlock, rwlock_with_condvars, RWlockReadMode, RWlockWriteMode;
|
||||
|
||||
import unsafe::{Exclusive, exclusive};
|
||||
|
||||
@ -362,7 +362,7 @@ impl &Semaphore {
|
||||
struct Mutex { priv sem: Sem<~[mut Waitqueue]>; }
|
||||
|
||||
/// Create a new mutex, with one associated condvar.
|
||||
fn mutex() -> Mutex { mutex_with_condvars(1) }
|
||||
fn Mutex() -> Mutex { mutex_with_condvars(1) }
|
||||
/**
|
||||
* Create a new mutex, with a specified number of associated condvars. This
|
||||
* will allow calling wait_on/signal_on/broadcast_on with condvar IDs between
|
||||
@ -412,7 +412,7 @@ struct RWlock {
|
||||
}
|
||||
|
||||
/// Create a new rwlock, with one associated condvar.
|
||||
fn rwlock() -> RWlock { rwlock_with_condvars(1) }
|
||||
fn RWlock() -> RWlock { rwlock_with_condvars(1) }
|
||||
|
||||
/**
|
||||
* Create a new rwlock, with a specified number of associated condvars.
|
||||
@ -745,7 +745,7 @@ mod tests {
|
||||
// Unsafely achieve shared state, and do the textbook
|
||||
// "load tmp <- ptr; inc tmp; store ptr <- tmp" dance.
|
||||
let (c,p) = pipes::stream();
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let m2 = ~m.clone();
|
||||
let sharedstate = ~0;
|
||||
let ptr = ptr::addr_of(*sharedstate);
|
||||
@ -773,7 +773,7 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_mutex_cond_wait() {
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
|
||||
// Child wakes up parent
|
||||
do m.lock_cond |cond| {
|
||||
@ -805,7 +805,7 @@ mod tests {
|
||||
}
|
||||
#[cfg(test)]
|
||||
fn test_mutex_cond_broadcast_helper(num_waiters: uint) {
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let mut ports = ~[];
|
||||
|
||||
for num_waiters.times {
|
||||
@ -840,7 +840,7 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_mutex_cond_no_waiter() {
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let m2 = ~m.clone();
|
||||
do task::try {
|
||||
do m.lock_cond |_x| { }
|
||||
@ -852,7 +852,7 @@ mod tests {
|
||||
#[test] #[ignore(cfg(windows))]
|
||||
fn test_mutex_killed_simple() {
|
||||
// Mutex must get automatically unlocked if failed/killed within.
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let m2 = ~m.clone();
|
||||
|
||||
let result: result::Result<(),()> = do task::try {
|
||||
@ -868,7 +868,7 @@ mod tests {
|
||||
fn test_mutex_killed_cond() {
|
||||
// Getting killed during cond wait must not corrupt the mutex while
|
||||
// unwinding (e.g. double unlock).
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let m2 = ~m.clone();
|
||||
|
||||
let result: result::Result<(),()> = do task::try {
|
||||
@ -892,7 +892,7 @@ mod tests {
|
||||
}
|
||||
#[test] #[ignore(cfg(windows))]
|
||||
fn test_mutex_killed_broadcast() {
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
let m2 = ~m.clone();
|
||||
let (c,p) = pipes::stream();
|
||||
|
||||
@ -936,7 +936,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_mutex_cond_signal_on_0() {
|
||||
// Tests that signal_on(0) is equivalent to signal().
|
||||
let m = ~mutex();
|
||||
let m = ~Mutex();
|
||||
do m.lock_cond |cond| {
|
||||
let m2 = ~m.clone();
|
||||
do task::spawn {
|
||||
@ -1040,17 +1040,17 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_readers_wont_modify_the_data() {
|
||||
test_rwlock_exclusion(~rwlock(), Read, Write);
|
||||
test_rwlock_exclusion(~rwlock(), Write, Read);
|
||||
test_rwlock_exclusion(~rwlock(), Read, Downgrade);
|
||||
test_rwlock_exclusion(~rwlock(), Downgrade, Read);
|
||||
test_rwlock_exclusion(~RWlock(), Read, Write);
|
||||
test_rwlock_exclusion(~RWlock(), Write, Read);
|
||||
test_rwlock_exclusion(~RWlock(), Read, Downgrade);
|
||||
test_rwlock_exclusion(~RWlock(), Downgrade, Read);
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_writers_and_writers() {
|
||||
test_rwlock_exclusion(~rwlock(), Write, Write);
|
||||
test_rwlock_exclusion(~rwlock(), Write, Downgrade);
|
||||
test_rwlock_exclusion(~rwlock(), Downgrade, Write);
|
||||
test_rwlock_exclusion(~rwlock(), Downgrade, Downgrade);
|
||||
test_rwlock_exclusion(~RWlock(), Write, Write);
|
||||
test_rwlock_exclusion(~RWlock(), Write, Downgrade);
|
||||
test_rwlock_exclusion(~RWlock(), Downgrade, Write);
|
||||
test_rwlock_exclusion(~RWlock(), Downgrade, Downgrade);
|
||||
}
|
||||
#[cfg(test)]
|
||||
fn test_rwlock_handshake(+x: ~RWlock, mode1: RWlockMode,
|
||||
@ -1084,32 +1084,32 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_readers_and_readers() {
|
||||
test_rwlock_handshake(~rwlock(), Read, Read, false);
|
||||
test_rwlock_handshake(~RWlock(), Read, Read, false);
|
||||
// The downgrader needs to get in before the reader gets in, otherwise
|
||||
// they cannot end up reading at the same time.
|
||||
test_rwlock_handshake(~rwlock(), DowngradeRead, Read, false);
|
||||
test_rwlock_handshake(~rwlock(), Read, DowngradeRead, true);
|
||||
test_rwlock_handshake(~RWlock(), DowngradeRead, Read, false);
|
||||
test_rwlock_handshake(~RWlock(), Read, DowngradeRead, true);
|
||||
// Two downgrade_reads can never both end up reading at the same time.
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_downgrade_unlock() {
|
||||
// Tests that downgrade can unlock the lock in both modes
|
||||
let x = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
do lock_rwlock_in_mode(x, Downgrade) { }
|
||||
test_rwlock_handshake(x, Read, Read, false);
|
||||
let y = ~rwlock();
|
||||
let y = ~RWlock();
|
||||
do lock_rwlock_in_mode(y, DowngradeRead) { }
|
||||
test_rwlock_exclusion(y, Write, Write);
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_read_recursive() {
|
||||
let x = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
do x.read { do x.read { } }
|
||||
}
|
||||
#[test]
|
||||
fn test_rwlock_cond_wait() {
|
||||
// As test_mutex_cond_wait above.
|
||||
let x = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
|
||||
// Child wakes up parent
|
||||
do x.write_cond |cond| {
|
||||
@ -1154,7 +1154,7 @@ mod tests {
|
||||
x.write_cond(blk)
|
||||
}
|
||||
}
|
||||
let x = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
let mut ports = ~[];
|
||||
|
||||
for num_waiters.times {
|
||||
@ -1193,7 +1193,7 @@ mod tests {
|
||||
#[cfg(test)] #[ignore(cfg(windows))]
|
||||
fn rwlock_kill_helper(mode1: RWlockMode, mode2: RWlockMode) {
|
||||
// Mutex must get automatically unlocked if failed/killed within.
|
||||
let x = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
let x2 = ~x.clone();
|
||||
|
||||
let result: result::Result<(),()> = do task::try {
|
||||
@ -1231,8 +1231,8 @@ mod tests {
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_rwlock_downgrade_cant_swap() {
|
||||
// Tests that you can't downgrade with a different rwlock's token.
|
||||
let x = ~rwlock();
|
||||
let y = ~rwlock();
|
||||
let x = ~RWlock();
|
||||
let y = ~RWlock();
|
||||
do x.write_downgrade |xwrite| {
|
||||
let mut xopt = Some(xwrite);
|
||||
do y.write_downgrade |_ywrite| {
|
||||
|
@ -136,7 +136,7 @@ fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
|
||||
def: ast::def_id) -> ty::ty_param_bounds_and_ty {
|
||||
let cstore = tcx.cstore;
|
||||
let cdata = cstore::get_crate_data(cstore, class_id.crate);
|
||||
let all_items = ebml::get_doc(ebml::doc(cdata.data), tag_items);
|
||||
let all_items = ebml::get_doc(ebml::Doc(cdata.data), tag_items);
|
||||
debug!("Looking up %?", class_id);
|
||||
let class_doc = expect(tcx.diag,
|
||||
decoder::maybe_find_item(class_id.node, all_items),
|
||||
|
@ -98,7 +98,7 @@ fn find_item(item_id: int, items: ebml::Doc) -> ebml::Doc {
|
||||
// Looks up an item in the given metadata and returns an ebml doc pointing
|
||||
// to the item data.
|
||||
fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc {
|
||||
let items = ebml::get_doc(ebml::doc(data), tag_items);
|
||||
let items = ebml::get_doc(ebml::Doc(data), tag_items);
|
||||
match maybe_find_item(item_id, items) {
|
||||
None => fail(fmt!("lookup_item: id not found: %d", item_id)),
|
||||
Some(d) => d
|
||||
@ -362,7 +362,7 @@ fn get_impl_traits(cdata: cmd, id: ast::node_id, tcx: ty::ctxt) -> ~[ty::t] {
|
||||
|
||||
fn get_impl_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
|
||||
name: ast::ident) -> ast::def_id {
|
||||
let items = ebml::get_doc(ebml::doc(cdata.data), tag_items);
|
||||
let items = ebml::get_doc(ebml::Doc(cdata.data), tag_items);
|
||||
let mut found = None;
|
||||
for ebml::tagged_docs(find_item(id, items), tag_item_impl_method) |mid| {
|
||||
let m_did = ebml::with_doc_data(mid, |d| parse_def_id(d));
|
||||
@ -375,7 +375,7 @@ fn get_impl_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
|
||||
|
||||
fn get_class_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
|
||||
name: ast::ident) -> ast::def_id {
|
||||
let items = ebml::get_doc(ebml::doc(cdata.data), tag_items);
|
||||
let items = ebml::get_doc(ebml::Doc(cdata.data), tag_items);
|
||||
let mut found = None;
|
||||
let cls_items = match maybe_find_item(id, items) {
|
||||
Some(it) => it,
|
||||
@ -396,7 +396,7 @@ fn get_class_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
|
||||
}
|
||||
|
||||
fn class_dtor(cdata: cmd, id: ast::node_id) -> Option<ast::def_id> {
|
||||
let items = ebml::get_doc(ebml::doc(cdata.data), tag_items);
|
||||
let items = ebml::get_doc(ebml::Doc(cdata.data), tag_items);
|
||||
let mut found = None;
|
||||
let cls_items = match maybe_find_item(id, items) {
|
||||
Some(it) => it,
|
||||
@ -445,7 +445,7 @@ struct path_entry {
|
||||
|
||||
/// Iterates over all the paths in the given crate.
|
||||
fn each_path(intr: ident_interner, cdata: cmd, f: fn(path_entry) -> bool) {
|
||||
let root = ebml::doc(cdata.data);
|
||||
let root = ebml::Doc(cdata.data);
|
||||
let items = ebml::get_doc(root, tag_items);
|
||||
let items_data = ebml::get_doc(items, tag_items_data);
|
||||
|
||||
@ -564,7 +564,7 @@ fn maybe_get_item_ast(intr: ident_interner, cdata: cmd, tcx: ty::ctxt,
|
||||
fn get_enum_variants(intr: ident_interner, cdata: cmd, id: ast::node_id,
|
||||
tcx: ty::ctxt) -> ~[ty::variant_info] {
|
||||
let data = cdata.data;
|
||||
let items = ebml::get_doc(ebml::doc(data), tag_items);
|
||||
let items = ebml::get_doc(ebml::Doc(data), tag_items);
|
||||
let item = find_item(id, items);
|
||||
let mut infos: ~[ty::variant_info] = ~[];
|
||||
let variant_ids = enum_variant_ids(item, cdata);
|
||||
@ -888,7 +888,7 @@ fn list_crate_attributes(intr: ident_interner, md: ebml::Doc, hash: ~str,
|
||||
}
|
||||
|
||||
fn get_crate_attributes(data: @~[u8]) -> ~[ast::attribute] {
|
||||
return get_attributes(ebml::doc(data));
|
||||
return get_attributes(ebml::Doc(data));
|
||||
}
|
||||
|
||||
type crate_dep = {cnum: ast::crate_num, name: ast::ident,
|
||||
@ -896,7 +896,7 @@ type crate_dep = {cnum: ast::crate_num, name: ast::ident,
|
||||
|
||||
fn get_crate_deps(intr: ident_interner, data: @~[u8]) -> ~[crate_dep] {
|
||||
let mut deps: ~[crate_dep] = ~[];
|
||||
let cratedoc = ebml::doc(data);
|
||||
let cratedoc = ebml::Doc(data);
|
||||
let depsdoc = ebml::get_doc(cratedoc, tag_crate_deps);
|
||||
let mut crate_num = 1;
|
||||
fn docstr(doc: ebml::Doc, tag_: uint) -> ~str {
|
||||
@ -925,7 +925,7 @@ fn list_crate_deps(intr: ident_interner, data: @~[u8], out: io::Writer) {
|
||||
}
|
||||
|
||||
fn get_crate_hash(data: @~[u8]) -> ~str {
|
||||
let cratedoc = ebml::doc(data);
|
||||
let cratedoc = ebml::Doc(data);
|
||||
let hashdoc = ebml::get_doc(cratedoc, tag_crate_hash);
|
||||
return str::from_bytes(ebml::doc_data(hashdoc));
|
||||
}
|
||||
@ -981,7 +981,7 @@ fn get_crate_module_paths(intr: ident_interner, cdata: cmd)
|
||||
fn list_crate_metadata(intr: ident_interner, bytes: @~[u8],
|
||||
out: io::Writer) {
|
||||
let hash = get_crate_hash(bytes);
|
||||
let md = ebml::doc(bytes);
|
||||
let md = ebml::Doc(bytes);
|
||||
list_crate_attributes(intr, md, hash, out);
|
||||
list_crate_deps(intr, bytes, out);
|
||||
}
|
||||
|
@ -939,7 +939,7 @@ fn roundtrip(in_item: @ast::item) {
|
||||
let mbuf = io::mem_buffer();
|
||||
let ebml_w = ebml::Writer(io::mem_buffer_writer(mbuf));
|
||||
encode_item_ast(ebml_w, in_item);
|
||||
let ebml_doc = ebml::doc(@io::mem_buffer_buf(mbuf));
|
||||
let ebml_doc = ebml::Doc(@io::mem_buffer_buf(mbuf));
|
||||
let out_item = decode_item_ast(ebml_doc);
|
||||
|
||||
let exp_str =
|
||||
|
@ -241,7 +241,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
|
||||
i += 1u;
|
||||
let old_len = colors.len();
|
||||
|
||||
let color = arc::arc(colors);
|
||||
let color = arc::ARC(colors);
|
||||
|
||||
colors = do par::mapi_factory(*arc::get(&color)) {
|
||||
let colors = arc::clone(&color);
|
||||
@ -414,7 +414,7 @@ fn main(args: ~[~str]) {
|
||||
let mut total_seq = 0.0;
|
||||
let mut total_par = 0.0;
|
||||
|
||||
let graph_arc = arc::arc(copy graph);
|
||||
let graph_arc = arc::ARC(copy graph);
|
||||
|
||||
do gen_search_keys(graph, num_keys).map() |root| {
|
||||
io::stdout().write_line(~"");
|
||||
|
@ -32,7 +32,7 @@ fn recv(p: &pipe) -> uint {
|
||||
}
|
||||
|
||||
fn init() -> (pipe,pipe) {
|
||||
let m = arc::mutex_arc(~[]);
|
||||
let m = arc::MutexARC(~[]);
|
||||
((&m).clone(), m)
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ fn recv(p: &pipe) -> uint {
|
||||
}
|
||||
|
||||
fn init() -> (pipe,pipe) {
|
||||
let x = arc::rw_arc(~[]);
|
||||
let x = arc::RWARC(~[]);
|
||||
((&x).clone(), x)
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::arc;
|
||||
fn main() {
|
||||
let x = ~arc::rw_arc(1);
|
||||
let x = ~arc::RWARC(1);
|
||||
let mut y = None;
|
||||
do x.write_cond |_one, cond| {
|
||||
y = Some(cond);
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std;
|
||||
import std::arc;
|
||||
fn main() {
|
||||
let x = ~arc::rw_arc(1);
|
||||
let x = ~arc::RWARC(1);
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
y = Some(x.downgrade(write_mode));
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::arc;
|
||||
fn main() {
|
||||
let x = ~arc::rw_arc(1);
|
||||
let x = ~arc::RWARC(1);
|
||||
let mut y = None;
|
||||
do x.write |one| {
|
||||
y = Some(one);
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::arc;
|
||||
fn main() {
|
||||
let x = ~arc::rw_arc(1);
|
||||
let x = ~arc::RWARC(1);
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
do (&write_mode).write_cond |_one, cond| {
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::arc;
|
||||
fn main() {
|
||||
let x = ~arc::rw_arc(1);
|
||||
let x = ~arc::RWARC(1);
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
y = Some(write_mode);
|
||||
|
@ -6,7 +6,7 @@ import comm::*;
|
||||
|
||||
fn main() {
|
||||
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
let arc_v = arc::arc(v);
|
||||
let arc_v = arc::ARC(v);
|
||||
|
||||
do task::spawn() {
|
||||
let v = *arc::get(&arc_v);
|
||||
|
@ -4,7 +4,7 @@ import comm::*;
|
||||
|
||||
fn main() {
|
||||
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
let arc_v = arc::arc(v);
|
||||
let arc_v = arc::ARC(v);
|
||||
|
||||
do task::spawn() |move arc_v| { //~ NOTE move of variable occurred here
|
||||
let v = *arc::get(&arc_v);
|
||||
|
@ -3,7 +3,7 @@ use std;
|
||||
import std::sync;
|
||||
|
||||
fn main() {
|
||||
let m = ~sync::mutex();
|
||||
let m = ~sync::Mutex();
|
||||
let mut cond = None;
|
||||
do m.lock_cond |c| {
|
||||
cond = Some(c);
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::sync;
|
||||
fn main() {
|
||||
let x = ~sync::rwlock();
|
||||
let x = ~sync::RWlock();
|
||||
let mut y = None;
|
||||
do x.write_cond |cond| {
|
||||
y = Some(cond);
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::sync;
|
||||
fn main() {
|
||||
let x = ~sync::rwlock();
|
||||
let x = ~sync::RWlock();
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
y = Some(x.downgrade(write_mode));
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::sync;
|
||||
fn main() {
|
||||
let x = ~sync::rwlock();
|
||||
let x = ~sync::RWlock();
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
do (&write_mode).write_cond |cond| {
|
||||
|
@ -2,7 +2,7 @@
|
||||
use std;
|
||||
import std::sync;
|
||||
fn main() {
|
||||
let x = ~sync::rwlock();
|
||||
let x = ~sync::RWlock();
|
||||
let mut y = None;
|
||||
do x.write_downgrade |write_mode| {
|
||||
y = Some(write_mode);
|
||||
|
@ -23,7 +23,7 @@ fn test_ser_and_deser<A>(a1: A,
|
||||
let buf = io::mem_buffer();
|
||||
let w = ebml::Writer(buf as io::Writer);
|
||||
ebml_ser_fn(w, a1);
|
||||
let d = ebml::doc(@io::mem_buffer_buf(buf));
|
||||
let d = ebml::Doc(@io::mem_buffer_buf(buf));
|
||||
let a2 = ebml_deser_fn(ebml::ebml_deserializer(d));
|
||||
io::print(~"\na1 = ");
|
||||
io_ser_fn(io::stdout(), a1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user