diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 9d15deab660..60db62ce01a 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -1,5 +1,5 @@ // NB: transitionary, de-mode-ing. -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap /** * Concurrency-enabled mechanisms for sharing mutable and/or immutable state * between tasks. @@ -66,7 +66,7 @@ impl &Condvar { struct ARC { x: SharedMutableState } /// Create an atomically reference counted wrapper. -pub fn ARC(+data: T) -> ARC { +pub fn ARC(data: T) -> ARC { ARC { x: unsafe { shared_mutable_state(move data) } } } @@ -98,7 +98,7 @@ pub fn clone(rc: &ARC) -> ARC { * unwrap from a task that holds another reference to the same ARC; it is * guaranteed to deadlock. */ -fn unwrap(+rc: ARC) -> T { +fn unwrap(rc: ARC) -> T { let ARC { x: x } <- rc; unsafe { unwrap_shared_mutable_state(move x) } } @@ -113,14 +113,14 @@ struct MutexARCInner { lock: Mutex, failed: bool, data: T } struct MutexARC { x: SharedMutableState> } /// Create a mutex-protected ARC with the supplied data. -pub fn MutexARC(+user_data: T) -> MutexARC { +pub fn MutexARC(user_data: T) -> MutexARC { mutex_arc_with_condvars(move user_data, 1) } /** * Create a mutex-protected ARC with the supplied data and a specified number * of condvars (as sync::mutex_with_condvars). */ -pub fn mutex_arc_with_condvars(+user_data: T, +pub fn mutex_arc_with_condvars(user_data: T, num_condvars: uint) -> MutexARC { let data = MutexARCInner { lock: mutex_with_condvars(num_condvars), @@ -191,7 +191,7 @@ impl &MutexARC { * Will additionally fail if another task has failed while accessing the arc. */ // FIXME(#2585) make this a by-move method on the arc -pub fn unwrap_mutex_arc(+arc: MutexARC) -> T { +pub fn unwrap_mutex_arc(arc: MutexARC) -> T { let MutexARC { x: x } <- arc; let inner = unsafe { unwrap_shared_mutable_state(move x) }; let MutexARCInner { failed: failed, data: data, _ } <- inner; @@ -247,14 +247,14 @@ struct RWARC { } /// Create a reader/writer ARC with the supplied data. -pub fn RWARC(+user_data: T) -> RWARC { +pub fn RWARC(user_data: T) -> RWARC { rw_arc_with_condvars(move user_data, 1) } /** * Create a reader/writer ARC with the supplied data and a specified number * of condvars (as sync::rwlock_with_condvars). */ -pub fn rw_arc_with_condvars(+user_data: T, +pub fn rw_arc_with_condvars(user_data: T, num_condvars: uint) -> RWARC { let data = RWARCInner { lock: rwlock_with_condvars(num_condvars), @@ -334,7 +334,7 @@ impl &RWARC { * } * ~~~ */ - fn write_downgrade(blk: fn(+v: RWWriteMode) -> U) -> U { + fn write_downgrade(blk: fn(v: RWWriteMode) -> U) -> U { let state = unsafe { get_shared_mutable_state(&self.x) }; do borrow_rwlock(state).write_downgrade |write_mode| { check_poison(false, state.failed); @@ -344,7 +344,7 @@ impl &RWARC { } /// To be called inside of the write_downgrade block. - fn downgrade(+token: RWWriteMode/&a) -> RWReadMode/&a { + fn downgrade(token: RWWriteMode/&a) -> RWReadMode/&a { // The rwlock should assert that the token belongs to us for us. let state = unsafe { get_shared_immutable_state(&self.x) }; let RWWriteMode((data, t, _poison)) <- token; @@ -369,7 +369,7 @@ impl &RWARC { * in write mode. */ // FIXME(#2585) make this a by-move method on the arc -pub fn unwrap_rw_arc(+arc: RWARC) -> T { +pub fn unwrap_rw_arc(arc: RWARC) -> T { let RWARC { x: x, _ } <- arc; let inner = unsafe { unwrap_shared_mutable_state(move x) }; let RWARCInner { failed: failed, data: data, _ } <- inner; diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index bb556ed2ca3..77f0d39c338 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -1,4 +1,4 @@ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use vec::{to_mut, from_elem}; @@ -95,7 +95,7 @@ struct BigBitv { mut storage: ~[mut uint] } -fn BigBitv(+storage: ~[mut uint]) -> BigBitv { +fn BigBitv(storage: ~[mut uint]) -> BigBitv { BigBitv {storage: storage} } diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 43e47e1e1a9..866dbce1c08 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -1,4 +1,4 @@ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap /// A dynamic, mutable location. /// /// Similar to a mutable option type, but friendlier. @@ -8,7 +8,7 @@ pub struct Cell { } /// Creates a new full cell with the given value. -pub fn Cell(+value: T) -> Cell { +pub fn Cell(value: T) -> Cell { Cell { value: Some(move value) } } @@ -29,7 +29,7 @@ impl Cell { } /// Returns the value, failing if the cell is full. - fn put_back(+value: T) { + fn put_back(value: T) { if !self.is_empty() { fail ~"attempt to put a value back into a full cell"; } diff --git a/src/libstd/dbg.rs b/src/libstd/dbg.rs index df97df51643..f85d4655ad1 100644 --- a/src/libstd/dbg.rs +++ b/src/libstd/dbg.rs @@ -1,4 +1,4 @@ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap //! Unsafe debugging functions for inspecting values. use cast::reinterpret_cast; @@ -20,7 +20,7 @@ pub fn debug_tydesc() { rustrt::debug_tydesc(sys::get_type_desc::()); } -pub fn debug_opaque(+x: T) { +pub fn debug_opaque(x: T) { rustrt::debug_opaque(sys::get_type_desc::(), ptr::addr_of(&x) as *()); } @@ -28,11 +28,11 @@ pub fn debug_box(x: @T) { rustrt::debug_box(sys::get_type_desc::(), ptr::addr_of(&x) as *()); } -pub fn debug_tag(+x: T) { +pub fn debug_tag(x: T) { rustrt::debug_tag(sys::get_type_desc::(), ptr::addr_of(&x) as *()); } -pub fn debug_fn(+x: T) { +pub fn debug_fn(x: T) { rustrt::debug_fn(sys::get_type_desc::(), ptr::addr_of(&x) as *()); } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index da05174a6f5..f4fbc11c4f7 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -1,5 +1,5 @@ //! A deque. Untested as of yet. Likely buggy -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap #[forbid(non_camel_case_types)]; use option::{Some, None}; @@ -8,8 +8,8 @@ use core::cmp::{Eq}; pub trait Deque { fn size() -> uint; - fn add_front(+v: T); - fn add_back(+v: T); + fn add_front(v: T); + fn add_back(v: T); fn pop_front() -> T; fn pop_back() -> T; fn peek_front() -> T; @@ -27,7 +27,7 @@ pub fn create() -> Deque { * Grow is only called on full elts, so nelts is also len(elts), unlike * elsewhere. */ - fn grow(nelts: uint, lo: uint, +elts: ~[Cell]) + fn grow(nelts: uint, lo: uint, elts: ~[Cell]) -> ~[Cell] { let mut elts = move elts; assert (nelts == vec::len(elts)); @@ -55,7 +55,7 @@ pub fn create() -> Deque { impl Repr: Deque { fn size() -> uint { return self.nelts; } - fn add_front(+t: T) { + fn add_front(t: T) { let oldlo: uint = self.lo; if self.lo == 0u { self.lo = self.elts.len() - 1u; @@ -68,7 +68,7 @@ pub fn create() -> Deque { self.elts.set_elt(self.lo, Some(t)); self.nelts += 1u; } - fn add_back(+t: T) { + fn add_back(t: T) { if self.lo == self.hi && self.nelts != 0u { self.elts.swap(|v| grow(self.nelts, self.lo, move v)); self.lo = 0u; @@ -200,7 +200,7 @@ mod tests { assert (deq.get(3) == d); } - fn test_parameterized(+a: T, +b: T, +c: T, +d: T) { + fn test_parameterized(a: T, +b: T, +c: T, +d: T) { let deq: deque::Deque = deque::create::(); assert (deq.size() == 0u); deq.add_front(a); diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 9d127f5db47..8fd775c4773 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -62,7 +62,7 @@ * } */ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use core::cmp::Eq; use core::result::{Err, Ok}; @@ -179,7 +179,7 @@ pub enum Fail_ { } /// Convert a `fail_` enum into an error string -pub fn fail_str(+f: Fail_) -> ~str { +pub fn fail_str(f: Fail_) -> ~str { return match f { ArgumentMissing(ref nm) => { ~"Argument to option '" + *nm + ~"' missing." @@ -335,7 +335,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result unsafe { free: free}); } -fn opt_vals(+mm: Matches, nm: &str) -> ~[Optval] { +fn opt_vals(mm: Matches, nm: &str) -> ~[Optval] { return match find_opt(mm.opts, mkname(nm)) { Some(id) => mm.vals[id], None => { @@ -345,15 +345,15 @@ fn opt_vals(+mm: Matches, nm: &str) -> ~[Optval] { }; } -fn opt_val(+mm: Matches, nm: &str) -> Optval { return opt_vals(mm, nm)[0]; } +fn opt_val(mm: Matches, nm: &str) -> Optval { return opt_vals(mm, nm)[0]; } /// Returns true if an option was matched -pub fn opt_present(+mm: Matches, nm: &str) -> bool { +pub fn opt_present(mm: Matches, nm: &str) -> bool { return vec::len::(opt_vals(mm, nm)) > 0u; } /// Returns true if any of several options were matched -pub fn opts_present(+mm: Matches, names: &[~str]) -> bool { +pub fn opts_present(mm: Matches, names: &[~str]) -> bool { for vec::each(names) |nm| { match find_opt(mm.opts, mkname(*nm)) { Some(_) => return true, @@ -370,7 +370,7 @@ pub fn opts_present(+mm: Matches, names: &[~str]) -> bool { * Fails if the option was not matched or if the match did not take an * argument */ -pub fn opt_str(+mm: Matches, nm: &str) -> ~str { +pub fn opt_str(mm: Matches, nm: &str) -> ~str { return match opt_val(mm, nm) { Val(copy s) => s, _ => fail }; } @@ -380,7 +380,8 @@ pub fn opt_str(+mm: Matches, nm: &str) -> ~str { * Fails if the no option was provided from the given list, or if the no such * option took an argument */ -pub fn opts_str(+mm: Matches, names: &[~str]) -> ~str { +pub fn opts_str(mm: Matches, names: &[~str]) -> ~str { +>>>>>>> Remove uses of + mode from libstd for vec::each(names) |nm| { match opt_val(mm, *nm) { Val(copy s) => return s, @@ -397,7 +398,7 @@ pub fn opts_str(+mm: Matches, names: &[~str]) -> ~str { * * Used when an option accepts multiple values. */ -pub fn opt_strs(+mm: Matches, nm: &str) -> ~[~str] { +pub fn opt_strs(mm: Matches, nm: &str) -> ~[~str] { let mut acc: ~[~str] = ~[]; for vec::each(opt_vals(mm, nm)) |v| { match *v { Val(copy s) => acc.push(s), _ => () } @@ -406,7 +407,7 @@ pub fn opt_strs(+mm: Matches, nm: &str) -> ~[~str] { } /// Returns the string argument supplied to a matching option or none -pub fn opt_maybe_str(+mm: Matches, nm: &str) -> Option<~str> { +pub fn opt_maybe_str(mm: Matches, nm: &str) -> Option<~str> { let vals = opt_vals(mm, nm); if vec::len::(vals) == 0u { return None::<~str>; } return match vals[0] { @@ -423,7 +424,7 @@ pub fn opt_maybe_str(+mm: Matches, nm: &str) -> Option<~str> { * present but no argument was provided, and the argument if the option was * present and an argument was provided. */ -pub fn opt_default(+mm: Matches, nm: &str, def: &str) -> Option<~str> { +pub fn opt_default(mm: Matches, nm: &str, def: &str) -> Option<~str> { let vals = opt_vals(mm, nm); if vec::len::(vals) == 0u { return None::<~str>; } return match vals[0] { Val(copy s) => Some::<~str>(s), @@ -451,7 +452,7 @@ mod tests { use opt = getopts; use result::{Err, Ok}; - fn check_fail_type(+f: Fail_, ft: FailType) { + fn check_fail_type(f: Fail_, ft: FailType) { match f { ArgumentMissing(_) => assert ft == ArgumentMissing_, UnrecognizedOption(_) => assert ft == UnrecognizedOption_, diff --git a/src/libstd/json.rs b/src/libstd/json.rs index d3713bdb29d..f244f2869a6 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -1,6 +1,6 @@ // Rust JSON serialization library // Copyright (c) 2011 Google Inc. -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap #[forbid(non_camel_case_types)]; //! json serialization @@ -370,7 +370,7 @@ priv impl Parser { self.ch } - fn error(+msg: ~str) -> Result { + fn error(msg: ~str) -> Result { Err(Error { line: self.line, col: self.col, msg: @msg }) } diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 5b0931ebdee..4ff493f5ab9 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -29,7 +29,7 @@ pub fn from_vec(v: &[T]) -> @List { * * z - The initial value * * f - The function to apply */ -pub fn foldl(+z: T, ls: @List, f: fn((&T), (&U)) -> T) -> T { +pub fn foldl(z: T, ls: @List, f: fn((&T), (&U)) -> T) -> T { let mut accum: T = z; do iter(ls) |elt| { accum = f(&accum, elt);} accum diff --git a/src/libstd/map.rs b/src/libstd/map.rs index 84fee092562..cc42c562376 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -1,6 +1,6 @@ //! A map type -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use io::WriterUtil; use to_str::ToStr; @@ -28,10 +28,10 @@ pub trait Map { * * Returns true if the key did not already exist in the map */ - fn insert(+v: K, +v: V) -> bool; + fn insert(v: K, +v: V) -> bool; /// Returns true if the map contains a value for the specified key - fn contains_key(+key: K) -> bool; + fn contains_key(key: K) -> bool; /// Returns true if the map contains a value for the specified /// key, taking the key by reference. @@ -41,31 +41,31 @@ pub trait Map { * Get the value for the specified key. Fails if the key does not exist in * the map. */ - fn get(+key: K) -> V; + fn get(key: K) -> V; /** * Get the value for the specified key. If the key does not exist in * the map then returns none. */ - pure fn find(+key: K) -> Option; + pure fn find(key: K) -> Option; /** * Remove and return a value from the map. Returns true if the * key was present in the map, otherwise false. */ - fn remove(+key: K) -> bool; + fn remove(key: K) -> bool; /// Clear the map, removing all key/value pairs. fn clear(); /// Iterate over all the key/value pairs in the map by value - pure fn each(fn(+key: K, +value: V) -> bool); + pure fn each(fn(key: K, +value: V) -> bool); /// Iterate over all the keys in the map by value - pure fn each_key(fn(+key: K) -> bool); + pure fn each_key(fn(key: K) -> bool); /// Iterate over all the values in the map by value - pure fn each_value(fn(+value: V) -> bool); + pure fn each_value(fn(value: V) -> bool); /// Iterate over all the key/value pairs in the map by reference pure fn each_ref(fn(key: &K, value: &V) -> bool); @@ -201,7 +201,7 @@ pub mod chained { impl T: Map { pure fn size() -> uint { self.count } - fn contains_key(+k: K) -> bool { + fn contains_key(k: K) -> bool { self.contains_key_ref(&k) } @@ -213,7 +213,7 @@ pub mod chained { } } - fn insert(+k: K, +v: V) -> bool { + fn insert(k: K, +v: V) -> bool { let hash = k.hash_keyed(0,0) as uint; match self.search_tbl(&k, hash) { NotFound => { @@ -255,7 +255,7 @@ pub mod chained { } } - pure fn find(+k: K) -> Option { + pure fn find(k: K) -> Option { unsafe { match self.search_tbl(&k, k.hash_keyed(0,0) as uint) { NotFound => None, @@ -265,7 +265,7 @@ pub mod chained { } } - fn get(+k: K) -> V { + fn get(k: K) -> V { let opt_v = self.find(k); if opt_v.is_none() { fail fmt!("Key not found in table: %?", k); @@ -273,7 +273,7 @@ pub mod chained { option::unwrap(move opt_v) } - fn remove(+k: K) -> bool { + fn remove(k: K) -> bool { match self.search_tbl(&k, k.hash_keyed(0,0) as uint) { NotFound => false, FoundFirst(idx, entry) => { @@ -294,15 +294,15 @@ pub mod chained { self.chains = chains(initial_capacity); } - pure fn each(blk: fn(+key: K, +value: V) -> bool) { + pure fn each(blk: fn(key: K, +value: V) -> bool) { self.each_ref(|k, v| blk(*k, *v)) } - pure fn each_key(blk: fn(+key: K) -> bool) { + pure fn each_key(blk: fn(key: K) -> bool) { self.each_key_ref(|p| blk(*p)) } - pure fn each_value(blk: fn(+value: V) -> bool) { + pure fn each_value(blk: fn(value: V) -> bool) { self.each_value_ref(|p| blk(*p)) } @@ -377,7 +377,7 @@ pub fn HashMap() } /// Convenience function for adding keys to a hashmap with nil type keys -pub fn set_add(set: Set, +key: K) -> bool { +pub fn set_add(set: Set, key: K) -> bool { set.insert(key, ()) } @@ -415,13 +415,13 @@ impl @Mut>: } } - fn insert(+key: K, +value: V) -> bool { + fn insert(key: K, value: V) -> bool { do self.borrow_mut |p| { p.insert(key, value) } } - fn contains_key(+key: K) -> bool { + fn contains_key(key: K) -> bool { do self.borrow_const |p| { p.contains_key(&key) } @@ -433,13 +433,13 @@ impl @Mut>: } } - fn get(+key: K) -> V { + fn get(key: K) -> V { do self.borrow_const |p| { p.get(&key) } } - pure fn find(+key: K) -> Option { + pure fn find(key: K) -> Option { unsafe { do self.borrow_const |p| { p.find(&key) @@ -447,7 +447,7 @@ impl @Mut>: } } - fn remove(+key: K) -> bool { + fn remove(key: K) -> bool { do self.borrow_mut |p| { p.remove(&key) } @@ -459,7 +459,7 @@ impl @Mut>: } } - pure fn each(op: fn(+key: K, +value: V) -> bool) { + pure fn each(op: fn(key: K, +value: V) -> bool) { unsafe { do self.borrow_imm |p| { p.each(|k, v| op(*k, *v)) @@ -467,7 +467,7 @@ impl @Mut>: } } - pure fn each_key(op: fn(+key: K) -> bool) { + pure fn each_key(op: fn(key: K) -> bool) { unsafe { do self.borrow_imm |p| { p.each_key(|k| op(*k)) @@ -475,7 +475,7 @@ impl @Mut>: } } - pure fn each_value(op: fn(+value: V) -> bool) { + pure fn each_value(op: fn(value: V) -> bool) { unsafe { do self.borrow_imm |p| { p.each_value(|v| op(*v)) diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 59cb0d36f77..be38f16aff7 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -129,7 +129,7 @@ enum TcpConnectErrData { * the remote host. In the event of failure, a * `net::tcp::tcp_connect_err_data` instance will be returned */ -fn connect(+input_ip: ip::IpAddr, port: uint, +fn connect(input_ip: ip::IpAddr, port: uint, iotask: IoTask) -> result::Result unsafe { let result_po = core::comm::Port::(); @@ -570,7 +570,7 @@ fn accept(new_conn: TcpNewConnection) * successful/normal shutdown, and a `tcp_listen_err_data` enum in the event * of listen exiting because of an error */ -fn listen(+host_ip: ip::IpAddr, port: uint, backlog: uint, +fn listen(host_ip: ip::IpAddr, port: uint, backlog: uint, iotask: IoTask, +on_establish_cb: fn~(comm::Chan>), +new_connect_cb: fn~(TcpNewConnection, @@ -587,7 +587,7 @@ fn listen(+host_ip: ip::IpAddr, port: uint, backlog: uint, } } -fn listen_common(+host_ip: ip::IpAddr, port: uint, backlog: uint, +fn listen_common(host_ip: ip::IpAddr, port: uint, backlog: uint, iotask: IoTask, +on_establish_cb: fn~(comm::Chan>), +on_connect_cb: fn~(*uv::ll::uv_tcp_t)) @@ -728,7 +728,7 @@ fn listen_common(+host_ip: ip::IpAddr, port: uint, backlog: uint, * * A buffered wrapper that you can cast as an `io::reader` or `io::writer` */ -fn socket_buf(+sock: TcpSocket) -> TcpSocketBuf { +fn socket_buf(sock: TcpSocket) -> TcpSocketBuf { TcpSocketBuf(@{ sock: move sock, mut buf: ~[] }) } @@ -738,7 +738,7 @@ impl TcpSocket { result::Result<~[u8], TcpErrData>>, TcpErrData> { read_start(&self) } - fn read_stop(+read_port: + fn read_stop(read_port: comm::Port>) -> result::Result<(), TcpErrData> { read_stop(&self, move read_port) @@ -1476,7 +1476,7 @@ mod test { */ } - fn buf_write(+w: &W, val: &str) { + fn buf_write(w: &W, val: &str) { log(debug, fmt!("BUF_WRITE: val len %?", str::len(val))); do str::byte_slice(val) |b_slice| { log(debug, fmt!("BUF_WRITE: b_slice len %?", @@ -1485,7 +1485,7 @@ mod test { } } - fn buf_read(+r: &R, len: uint) -> ~str { + fn buf_read(r: &R, len: uint) -> ~str { let new_bytes = (*r).read_bytes(len); log(debug, fmt!("in buf_read.. new_bytes len: %?", vec::len(new_bytes))); diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 920751d690f..6dca075405b 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -1,5 +1,5 @@ //! Types/fns concerning URLs (see RFC 3986) -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after a snapshot use core::cmp::Eq; use map::HashMap; @@ -36,7 +36,7 @@ type UserInfo = { type Query = ~[(~str, ~str)]; -fn Url(+scheme: ~str, +user: Option, +host: ~str, +fn Url(scheme: ~str, +user: Option, +host: ~str, +port: Option<~str>, +path: ~str, +query: Query, +fragment: Option<~str>) -> Url { Url { scheme: move scheme, user: move user, host: move host, @@ -44,7 +44,7 @@ fn Url(+scheme: ~str, +user: Option, +host: ~str, fragment: move fragment } } -fn UserInfo(+user: ~str, +pass: Option<~str>) -> UserInfo { +fn UserInfo(user: ~str, +pass: Option<~str>) -> UserInfo { {user: move user, pass: move pass} } @@ -306,7 +306,7 @@ fn userinfo_from_str(uinfo: &str) -> UserInfo { return UserInfo(user, pass); } -fn userinfo_to_str(+userinfo: UserInfo) -> ~str { +fn userinfo_to_str(userinfo: UserInfo) -> ~str { if option::is_some(&userinfo.pass) { return str::concat(~[copy userinfo.user, ~":", option::unwrap(copy userinfo.pass), @@ -334,7 +334,7 @@ fn query_from_str(rawquery: &str) -> Query { return query; } -fn query_to_str(+query: Query) -> ~str { +fn query_to_str(query: Query) -> ~str { let mut strvec = ~[]; for query.each |kv| { let (k, v) = copy *kv; @@ -681,7 +681,7 @@ impl Url : FromStr { * result in just "http://somehost.com". * */ -fn to_str(+url: Url) -> ~str { +fn to_str(url: Url) -> ~str { let user = if url.user.is_some() { userinfo_to_str(option::unwrap(copy url.user)) } else { diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index d14a4854555..5df4fc10a03 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -379,7 +379,7 @@ Section: Iterating * `true` If execution proceeded correctly, `false` if it was interrupted, * that is if `it` returned `false` at any point. */ -pub fn loop_chars(rope: Rope, it: fn(+c: char) -> bool) -> bool { +pub fn loop_chars(rope: Rope, it: fn(c: char) -> bool) -> bool { match (rope) { node::Empty => return true, node::Content(x) => return node::loop_chars(x, it) @@ -1037,7 +1037,7 @@ mod node { return result; } - pub fn loop_chars(node: @Node, it: fn(+c: char) -> bool) -> bool { + pub fn loop_chars(node: @Node, it: fn(c: char) -> bool) -> bool { return loop_leaves(node,|leaf| { str::all_between(*leaf.content, leaf.byte_offset, diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index 2e7f47e0af0..58ecbb0d6c3 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -2,7 +2,7 @@ * A simple map based on a vector for small integer keys. Space requirements * are O(highest integer key). */ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use core::option; use core::option::{Some, None}; @@ -28,7 +28,7 @@ pub fn mk() -> SmallIntMap { * the specified key then the original value is replaced. */ #[inline(always)] -pub fn insert(self: SmallIntMap, key: uint, +val: T) { +pub fn insert(self: SmallIntMap, key: uint, val: T) { //io::println(fmt!("%?", key)); self.v.grow_set_elt(key, &None, Some(val)); } @@ -77,12 +77,12 @@ impl SmallIntMap: map::Map { sz } #[inline(always)] - fn insert(+key: uint, +value: V) -> bool { + fn insert(key: uint, value: V) -> bool { let exists = contains_key(self, key); insert(self, key, value); return !exists; } - fn remove(+key: uint) -> bool { + fn remove(key: uint) -> bool { if key >= self.v.len() { return false; } @@ -93,23 +93,23 @@ impl SmallIntMap: map::Map { fn clear() { self.v.set(~[]); } - fn contains_key(+key: uint) -> bool { + fn contains_key(key: uint) -> bool { contains_key(self, key) } fn contains_key_ref(key: &uint) -> bool { contains_key(self, *key) } - fn get(+key: uint) -> V { get(self, key) } - pure fn find(+key: uint) -> Option { find(self, key) } + fn get(key: uint) -> V { get(self, key) } + pure fn find(key: uint) -> Option { find(self, key) } fn rehash() { fail } - pure fn each(it: fn(+key: uint, +value: V) -> bool) { + pure fn each(it: fn(key: uint, +value: V) -> bool) { self.each_ref(|k, v| it(*k, *v)) } - pure fn each_key(it: fn(+key: uint) -> bool) { + pure fn each_key(it: fn(key: uint) -> bool) { self.each_ref(|k, _v| it(*k)) } - pure fn each_value(it: fn(+value: V) -> bool) { + pure fn each_value(it: fn(value: V) -> bool) { self.each_ref(|_k, v| it(*v)) } pure fn each_ref(it: fn(key: &uint, value: &V) -> bool) { diff --git a/src/libstd/std.rc b/src/libstd/std.rc index 202cb4932db..683ea589b91 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -18,9 +18,6 @@ not required in or otherwise suitable for the core library. #[no_core]; -// tjc: Added legacy_modes back in because it still uses + mode. -// Remove once + mode gets expunged from std. -#[legacy_modes]; #[legacy_exports]; #[allow(vecs_implicitly_copyable)]; diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index f66f2f5b5d3..f66134d3892 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -1,5 +1,5 @@ // NB: transitionary, de-mode-ing. -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap /** * The concurrency primitives you know and love. * @@ -69,7 +69,7 @@ struct SemInner { enum Sem = Exclusive>; #[doc(hidden)] -fn new_sem(count: int, +q: Q) -> Sem { +fn new_sem(count: int, q: Q) -> Sem { Sem(exclusive(SemInner { mut count: count, waiters: new_waitqueue(), blocked: q })) } @@ -535,7 +535,7 @@ impl &RWlock { * } * ~~~ */ - fn write_downgrade(blk: fn(+v: RWlockWriteMode) -> U) -> U { + fn write_downgrade(blk: fn(v: RWlockWriteMode) -> U) -> U { // Implementation slightly different from the slicker 'write's above. // The exit path is conditional on whether the caller downgrades. let mut _release = None; @@ -551,7 +551,7 @@ impl &RWlock { } /// To be called inside of the write_downgrade block. - fn downgrade(+token: RWlockWriteMode/&a) -> RWlockReadMode/&a { + fn downgrade(token: RWlockWriteMode/&a) -> RWlockReadMode/&a { if !ptr::ref_eq(self, token.lock) { fail ~"Can't downgrade() with a different rwlock's write_mode!"; } @@ -957,7 +957,7 @@ mod tests { drop { self.c.send(()); } } - fn SendOnFailure(+c: pipes::Chan<()>) -> SendOnFailure { + fn SendOnFailure(c: pipes::Chan<()>) -> SendOnFailure { SendOnFailure { c: c } @@ -1038,7 +1038,7 @@ mod tests { } } #[cfg(test)] - fn test_rwlock_exclusion(+x: ~RWlock, mode1: RWlockMode, + fn test_rwlock_exclusion(x: ~RWlock, mode1: RWlockMode, mode2: RWlockMode) { // Test mutual exclusion between readers and writers. Just like the // mutex mutual exclusion test, a ways above. @@ -1083,7 +1083,7 @@ mod tests { test_rwlock_exclusion(~RWlock(), Downgrade, Downgrade); } #[cfg(test)] - fn test_rwlock_handshake(+x: ~RWlock, mode1: RWlockMode, + fn test_rwlock_handshake(x: ~RWlock, mode1: RWlockMode, mode2: RWlockMode, make_mode2_go_first: bool) { // Much like sem_multi_resource. let x2 = ~x.clone(); diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 1df10a4d799..c5d9dd343fa 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -270,7 +270,7 @@ enum TestEvent { type MonitorMsg = (TestDesc, TestResult); fn run_tests(opts: &TestOpts, tests: &[TestDesc], - callback: fn@(+e: TestEvent)) { + callback: fn@(e: TestEvent)) { let mut filtered_tests = filter_tests(opts, tests); callback(TeFiltered(copy filtered_tests)); @@ -379,7 +379,7 @@ fn filter_tests(opts: &TestOpts, type TestFuture = {test: TestDesc, wait: fn@() -> TestResult}; -fn run_test(+test: TestDesc, monitor_ch: comm::Chan) { +fn run_test(test: TestDesc, monitor_ch: comm::Chan) { if test.ignore { core::comm::send(monitor_ch, (copy test, TrIgnored)); return; diff --git a/src/libstd/time.rs b/src/libstd/time.rs index 43cbc6da9bd..aef3bb2ac0a 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -1,4 +1,4 @@ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use core::cmp::Eq; use libc::{c_char, c_int, c_long, size_t, time_t}; @@ -589,7 +589,7 @@ pub fn strptime(s: &str, format: &str) -> Result { } } -fn strftime(format: &str, +tm: Tm) -> ~str { +fn strftime(format: &str, tm: Tm) -> ~str { fn parse_type(ch: char, tm: &Tm) -> ~str { //FIXME (#2350): Implement missing types. let die = || #fmt("strftime: can't understand this format %c ", diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index 8aaf7d3fd87..2aca87b942e 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -1,6 +1,6 @@ //! Utilities that leverage libuv's `uv_timer_*` API -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after snap use uv = uv; use uv::iotask; @@ -24,7 +24,7 @@ use comm = core::comm; * * val - a value of type T to send over the provided `ch` */ pub fn delayed_send(iotask: IoTask, - msecs: uint, ch: comm::Chan, +val: T) { + msecs: uint, ch: comm::Chan, val: T) { unsafe { let timer_done_po = core::comm::Port::<()>(); let timer_done_ch = core::comm::Chan(timer_done_po); diff --git a/src/libstd/uv_iotask.rs b/src/libstd/uv_iotask.rs index 876aa6f4af0..4a4a34704be 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -5,7 +5,7 @@ * `interact` function you can execute code in a uv callback. */ -#[forbid(deprecated_mode)]; +// tjc: forbid deprecated modes again after a snapshot use libc::c_void; use ptr::p2::addr_of; @@ -22,7 +22,7 @@ pub enum IoTask { }) } -pub fn spawn_iotask(+task: task::TaskBuilder) -> IoTask { +pub fn spawn_iotask(task: task::TaskBuilder) -> IoTask { do listen |iotask_ch| { diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index f0594475d04..50636054821 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -642,7 +642,7 @@ extern mod rustrt { fn rust_uv_addrinfo_as_sockaddr_in(input: *addrinfo) -> *sockaddr_in; fn rust_uv_addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6; fn rust_uv_malloc_buf_base_of(sug_size: libc::size_t) -> *u8; - fn rust_uv_free_base_of_buf(++buf: uv_buf_t); + fn rust_uv_free_base_of_buf(+buf: uv_buf_t); fn rust_uv_get_stream_handle_from_connect_req( connect_req: *uv_connect_t) -> *uv_stream_t; @@ -661,8 +661,8 @@ extern mod rustrt { fn rust_uv_get_data_for_req(req: *libc::c_void) -> *libc::c_void; fn rust_uv_set_data_for_req(req: *libc::c_void, data: *libc::c_void); - fn rust_uv_get_base_from_buf(++buf: uv_buf_t) -> *u8; - fn rust_uv_get_len_from_buf(++buf: uv_buf_t) -> libc::size_t; + fn rust_uv_get_base_from_buf(+buf: uv_buf_t) -> *u8; + fn rust_uv_get_len_from_buf(+buf: uv_buf_t) -> libc::size_t; // sizeof testing helpers fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint; diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index f35a3ce735f..a34fcc89c04 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -251,7 +251,7 @@ fn pbfs(&&graph: arc::ARC, key: node_id) -> bfs_result { colors = do par::mapi_factory(*color_vec) { let colors = arc::clone(&color); let graph = arc::clone(&graph); - fn~(i: uint, c: color) -> color { + fn~(+i: uint, +c: color) -> color { let c : color = c; let colors = arc::get(&colors); let graph = arc::get(&graph);