Skip to content

Commit f838e0e

Browse files
committed
---
yaml --- r: 30969 b: refs/heads/incoming c: f33539e h: refs/heads/master i: 30967: 91246cc v: v3
1 parent 1833342 commit f838e0e

File tree

22 files changed

+114
-116
lines changed

22 files changed

+114
-116
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 654b4d6987223752155b58804255a373d3410a96
9+
refs/heads/incoming: f33539e446d6f41d4a3296ed50a8f968e7950483
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libstd/arc.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// NB: transitionary, de-mode-ing.
2-
#[forbid(deprecated_mode)];
2+
// tjc: forbid deprecated modes again after snap
33
/**
44
* Concurrency-enabled mechanisms for sharing mutable and/or immutable state
55
* between tasks.
@@ -66,7 +66,7 @@ impl &Condvar {
6666
struct ARC<T: Const Send> { x: SharedMutableState<T> }
6767

6868
/// Create an atomically reference counted wrapper.
69-
pub fn ARC<T: Const Send>(+data: T) -> ARC<T> {
69+
pub fn ARC<T: Const Send>(data: T) -> ARC<T> {
7070
ARC { x: unsafe { shared_mutable_state(move data) } }
7171
}
7272

@@ -98,7 +98,7 @@ pub fn clone<T: Const Send>(rc: &ARC<T>) -> ARC<T> {
9898
* unwrap from a task that holds another reference to the same ARC; it is
9999
* guaranteed to deadlock.
100100
*/
101-
fn unwrap<T: Const Send>(+rc: ARC<T>) -> T {
101+
fn unwrap<T: Const Send>(rc: ARC<T>) -> T {
102102
let ARC { x: x } <- rc;
103103
unsafe { unwrap_shared_mutable_state(move x) }
104104
}
@@ -113,14 +113,14 @@ struct MutexARCInner<T: Send> { lock: Mutex, failed: bool, data: T }
113113
struct MutexARC<T: Send> { x: SharedMutableState<MutexARCInner<T>> }
114114

115115
/// Create a mutex-protected ARC with the supplied data.
116-
pub fn MutexARC<T: Send>(+user_data: T) -> MutexARC<T> {
116+
pub fn MutexARC<T: Send>(user_data: T) -> MutexARC<T> {
117117
mutex_arc_with_condvars(move user_data, 1)
118118
}
119119
/**
120120
* Create a mutex-protected ARC with the supplied data and a specified number
121121
* of condvars (as sync::mutex_with_condvars).
122122
*/
123-
pub fn mutex_arc_with_condvars<T: Send>(+user_data: T,
123+
pub fn mutex_arc_with_condvars<T: Send>(user_data: T,
124124
num_condvars: uint) -> MutexARC<T> {
125125
let data =
126126
MutexARCInner { lock: mutex_with_condvars(num_condvars),
@@ -191,7 +191,7 @@ impl<T: Send> &MutexARC<T> {
191191
* Will additionally fail if another task has failed while accessing the arc.
192192
*/
193193
// FIXME(#2585) make this a by-move method on the arc
194-
pub fn unwrap_mutex_arc<T: Send>(+arc: MutexARC<T>) -> T {
194+
pub fn unwrap_mutex_arc<T: Send>(arc: MutexARC<T>) -> T {
195195
let MutexARC { x: x } <- arc;
196196
let inner = unsafe { unwrap_shared_mutable_state(move x) };
197197
let MutexARCInner { failed: failed, data: data, _ } <- inner;
@@ -247,14 +247,14 @@ struct RWARC<T: Const Send> {
247247
}
248248
249249
/// Create a reader/writer ARC with the supplied data.
250-
pub fn RWARC<T: Const Send>(+user_data: T) -> RWARC<T> {
250+
pub fn RWARC<T: Const Send>(user_data: T) -> RWARC<T> {
251251
rw_arc_with_condvars(move user_data, 1)
252252
}
253253
/**
254254
* Create a reader/writer ARC with the supplied data and a specified number
255255
* of condvars (as sync::rwlock_with_condvars).
256256
*/
257-
pub fn rw_arc_with_condvars<T: Const Send>(+user_data: T,
257+
pub fn rw_arc_with_condvars<T: Const Send>(user_data: T,
258258
num_condvars: uint) -> RWARC<T> {
259259
let data =
260260
RWARCInner { lock: rwlock_with_condvars(num_condvars),
@@ -334,7 +334,7 @@ impl<T: Const Send> &RWARC<T> {
334334
* }
335335
* ~~~
336336
*/
337-
fn write_downgrade<U>(blk: fn(+v: RWWriteMode<T>) -> U) -> U {
337+
fn write_downgrade<U>(blk: fn(v: RWWriteMode<T>) -> U) -> U {
338338
let state = unsafe { get_shared_mutable_state(&self.x) };
339339
do borrow_rwlock(state).write_downgrade |write_mode| {
340340
check_poison(false, state.failed);
@@ -344,7 +344,7 @@ impl<T: Const Send> &RWARC<T> {
344344
}
345345
346346
/// To be called inside of the write_downgrade block.
347-
fn downgrade(+token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
347+
fn downgrade(token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
348348
// The rwlock should assert that the token belongs to us for us.
349349
let state = unsafe { get_shared_immutable_state(&self.x) };
350350
let RWWriteMode((data, t, _poison)) <- token;
@@ -369,7 +369,7 @@ impl<T: Const Send> &RWARC<T> {
369369
* in write mode.
370370
*/
371371
// FIXME(#2585) make this a by-move method on the arc
372-
pub fn unwrap_rw_arc<T: Const Send>(+arc: RWARC<T>) -> T {
372+
pub fn unwrap_rw_arc<T: Const Send>(arc: RWARC<T>) -> T {
373373
let RWARC { x: x, _ } <- arc;
374374
let inner = unsafe { unwrap_shared_mutable_state(move x) };
375375
let RWARCInner { failed: failed, data: data, _ } <- inner;

branches/incoming/src/libstd/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[forbid(deprecated_mode)];
1+
// tjc: forbid deprecated modes again after snap
22

33
use vec::{to_mut, from_elem};
44

@@ -95,7 +95,7 @@ struct BigBitv {
9595
mut storage: ~[mut uint]
9696
}
9797

98-
fn BigBitv(+storage: ~[mut uint]) -> BigBitv {
98+
fn BigBitv(storage: ~[mut uint]) -> BigBitv {
9999
BigBitv {storage: storage}
100100
}
101101

branches/incoming/src/libstd/cell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[forbid(deprecated_mode)];
1+
// tjc: forbid deprecated modes again after snap
22
/// A dynamic, mutable location.
33
///
44
/// Similar to a mutable option type, but friendlier.
@@ -8,7 +8,7 @@ pub struct Cell<T> {
88
}
99

1010
/// Creates a new full cell with the given value.
11-
pub fn Cell<T>(+value: T) -> Cell<T> {
11+
pub fn Cell<T>(value: T) -> Cell<T> {
1212
Cell { value: Some(move value) }
1313
}
1414

@@ -29,7 +29,7 @@ impl<T> Cell<T> {
2929
}
3030

3131
/// Returns the value, failing if the cell is full.
32-
fn put_back(+value: T) {
32+
fn put_back(value: T) {
3333
if !self.is_empty() {
3434
fail ~"attempt to put a value back into a full cell";
3535
}

branches/incoming/src/libstd/dbg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[forbid(deprecated_mode)];
1+
// tjc: forbid deprecated modes again after snap
22
//! Unsafe debugging functions for inspecting values.
33
44
use cast::reinterpret_cast;
@@ -20,19 +20,19 @@ pub fn debug_tydesc<T>() {
2020
rustrt::debug_tydesc(sys::get_type_desc::<T>());
2121
}
2222

23-
pub fn debug_opaque<T>(+x: T) {
23+
pub fn debug_opaque<T>(x: T) {
2424
rustrt::debug_opaque(sys::get_type_desc::<T>(), ptr::addr_of(&x) as *());
2525
}
2626

2727
pub fn debug_box<T>(x: @T) {
2828
rustrt::debug_box(sys::get_type_desc::<T>(), ptr::addr_of(&x) as *());
2929
}
3030

31-
pub fn debug_tag<T>(+x: T) {
31+
pub fn debug_tag<T>(x: T) {
3232
rustrt::debug_tag(sys::get_type_desc::<T>(), ptr::addr_of(&x) as *());
3333
}
3434

35-
pub fn debug_fn<T>(+x: T) {
35+
pub fn debug_fn<T>(x: T) {
3636
rustrt::debug_fn(sys::get_type_desc::<T>(), ptr::addr_of(&x) as *());
3737
}
3838

branches/incoming/src/libstd/deque.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! A deque. Untested as of yet. Likely buggy
2-
#[forbid(deprecated_mode)];
2+
// tjc: forbid deprecated modes again after snap
33
#[forbid(non_camel_case_types)];
44

55
use option::{Some, None};
@@ -8,8 +8,8 @@ use core::cmp::{Eq};
88

99
pub trait Deque<T> {
1010
fn size() -> uint;
11-
fn add_front(+v: T);
12-
fn add_back(+v: T);
11+
fn add_front(v: T);
12+
fn add_back(v: T);
1313
fn pop_front() -> T;
1414
fn pop_back() -> T;
1515
fn peek_front() -> T;
@@ -27,7 +27,7 @@ pub fn create<T: Copy>() -> Deque<T> {
2727
* Grow is only called on full elts, so nelts is also len(elts), unlike
2828
* elsewhere.
2929
*/
30-
fn grow<T: Copy>(nelts: uint, lo: uint, +elts: ~[Cell<T>])
30+
fn grow<T: Copy>(nelts: uint, lo: uint, elts: ~[Cell<T>])
3131
-> ~[Cell<T>] {
3232
let mut elts = move elts;
3333
assert (nelts == vec::len(elts));
@@ -55,7 +55,7 @@ pub fn create<T: Copy>() -> Deque<T> {
5555

5656
impl <T: Copy> Repr<T>: Deque<T> {
5757
fn size() -> uint { return self.nelts; }
58-
fn add_front(+t: T) {
58+
fn add_front(t: T) {
5959
let oldlo: uint = self.lo;
6060
if self.lo == 0u {
6161
self.lo = self.elts.len() - 1u;
@@ -68,7 +68,7 @@ pub fn create<T: Copy>() -> Deque<T> {
6868
self.elts.set_elt(self.lo, Some(t));
6969
self.nelts += 1u;
7070
}
71-
fn add_back(+t: T) {
71+
fn add_back(t: T) {
7272
if self.lo == self.hi && self.nelts != 0u {
7373
self.elts.swap(|v| grow(self.nelts, self.lo, move v));
7474
self.lo = 0u;
@@ -200,7 +200,7 @@ mod tests {
200200
assert (deq.get(3) == d);
201201
}
202202

203-
fn test_parameterized<T: Copy Eq Owned>(+a: T, +b: T, +c: T, +d: T) {
203+
fn test_parameterized<T: Copy Eq Owned>(a: T, +b: T, +c: T, +d: T) {
204204
let deq: deque::Deque<T> = deque::create::<T>();
205205
assert (deq.size() == 0u);
206206
deq.add_front(a);

branches/incoming/src/libstd/getopts.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* }
6363
*/
6464

65-
#[forbid(deprecated_mode)];
65+
// tjc: forbid deprecated modes again after snap
6666

6767
use core::cmp::Eq;
6868
use core::result::{Err, Ok};
@@ -179,7 +179,7 @@ pub enum Fail_ {
179179
}
180180

181181
/// Convert a `fail_` enum into an error string
182-
pub fn fail_str(+f: Fail_) -> ~str {
182+
pub fn fail_str(f: Fail_) -> ~str {
183183
return match f {
184184
ArgumentMissing(ref nm) => {
185185
~"Argument to option '" + *nm + ~"' missing."
@@ -335,7 +335,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result unsafe {
335335
free: free});
336336
}
337337
338-
fn opt_vals(+mm: Matches, nm: &str) -> ~[Optval] {
338+
fn opt_vals(mm: Matches, nm: &str) -> ~[Optval] {
339339
return match find_opt(mm.opts, mkname(nm)) {
340340
Some(id) => mm.vals[id],
341341
None => {
@@ -345,15 +345,15 @@ fn opt_vals(+mm: Matches, nm: &str) -> ~[Optval] {
345345
};
346346
}
347347

348-
fn opt_val(+mm: Matches, nm: &str) -> Optval { return opt_vals(mm, nm)[0]; }
348+
fn opt_val(mm: Matches, nm: &str) -> Optval { return opt_vals(mm, nm)[0]; }
349349

350350
/// Returns true if an option was matched
351-
pub fn opt_present(+mm: Matches, nm: &str) -> bool {
351+
pub fn opt_present(mm: Matches, nm: &str) -> bool {
352352
return vec::len::<Optval>(opt_vals(mm, nm)) > 0u;
353353
}
354354

355355
/// Returns true if any of several options were matched
356-
pub fn opts_present(+mm: Matches, names: &[~str]) -> bool {
356+
pub fn opts_present(mm: Matches, names: &[~str]) -> bool {
357357
for vec::each(names) |nm| {
358358
match find_opt(mm.opts, mkname(*nm)) {
359359
Some(_) => return true,
@@ -370,7 +370,7 @@ pub fn opts_present(+mm: Matches, names: &[~str]) -> bool {
370370
* Fails if the option was not matched or if the match did not take an
371371
* argument
372372
*/
373-
pub fn opt_str(+mm: Matches, nm: &str) -> ~str {
373+
pub fn opt_str(mm: Matches, nm: &str) -> ~str {
374374
return match opt_val(mm, nm) { Val(copy s) => s, _ => fail };
375375
}
376376

@@ -380,7 +380,8 @@ pub fn opt_str(+mm: Matches, nm: &str) -> ~str {
380380
* Fails if the no option was provided from the given list, or if the no such
381381
* option took an argument
382382
*/
383-
pub fn opts_str(+mm: Matches, names: &[~str]) -> ~str {
383+
pub fn opts_str(mm: Matches, names: &[~str]) -> ~str {
384+
>>>>>>> Remove uses of + mode from libstd
384385
for vec::each(names) |nm| {
385386
match opt_val(mm, *nm) {
386387
Val(copy s) => return s,
@@ -397,7 +398,7 @@ pub fn opts_str(+mm: Matches, names: &[~str]) -> ~str {
397398
*
398399
* Used when an option accepts multiple values.
399400
*/
400-
pub fn opt_strs(+mm: Matches, nm: &str) -> ~[~str] {
401+
pub fn opt_strs(mm: Matches, nm: &str) -> ~[~str] {
401402
let mut acc: ~[~str] = ~[];
402403
for vec::each(opt_vals(mm, nm)) |v| {
403404
match *v { Val(copy s) => acc.push(s), _ => () }
@@ -406,7 +407,7 @@ pub fn opt_strs(+mm: Matches, nm: &str) -> ~[~str] {
406407
}
407408

408409
/// Returns the string argument supplied to a matching option or none
409-
pub fn opt_maybe_str(+mm: Matches, nm: &str) -> Option<~str> {
410+
pub fn opt_maybe_str(mm: Matches, nm: &str) -> Option<~str> {
410411
let vals = opt_vals(mm, nm);
411412
if vec::len::<Optval>(vals) == 0u { return None::<~str>; }
412413
return match vals[0] {
@@ -423,7 +424,7 @@ pub fn opt_maybe_str(+mm: Matches, nm: &str) -> Option<~str> {
423424
* present but no argument was provided, and the argument if the option was
424425
* present and an argument was provided.
425426
*/
426-
pub fn opt_default(+mm: Matches, nm: &str, def: &str) -> Option<~str> {
427+
pub fn opt_default(mm: Matches, nm: &str, def: &str) -> Option<~str> {
427428
let vals = opt_vals(mm, nm);
428429
if vec::len::<Optval>(vals) == 0u { return None::<~str>; }
429430
return match vals[0] { Val(copy s) => Some::<~str>(s),
@@ -451,7 +452,7 @@ mod tests {
451452
use opt = getopts;
452453
use result::{Err, Ok};
453454

454-
fn check_fail_type(+f: Fail_, ft: FailType) {
455+
fn check_fail_type(f: Fail_, ft: FailType) {
455456
match f {
456457
ArgumentMissing(_) => assert ft == ArgumentMissing_,
457458
UnrecognizedOption(_) => assert ft == UnrecognizedOption_,

branches/incoming/src/libstd/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Rust JSON serialization library
22
// Copyright (c) 2011 Google Inc.
3-
#[forbid(deprecated_mode)];
3+
// tjc: forbid deprecated modes again after snap
44
#[forbid(non_camel_case_types)];
55

66
//! json serialization
@@ -370,7 +370,7 @@ priv impl Parser {
370370
self.ch
371371
}
372372

373-
fn error<T>(+msg: ~str) -> Result<T, Error> {
373+
fn error<T>(msg: ~str) -> Result<T, Error> {
374374
Err(Error { line: self.line, col: self.col, msg: @msg })
375375
}
376376

branches/incoming/src/libstd/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn from_vec<T: Copy>(v: &[T]) -> @List<T> {
2929
* * z - The initial value
3030
* * f - The function to apply
3131
*/
32-
pub fn foldl<T: Copy, U>(+z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
32+
pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
3333
let mut accum: T = z;
3434
do iter(ls) |elt| { accum = f(&accum, elt);}
3535
accum

0 commit comments

Comments
 (0)