diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs
index 6936de2bccbc..7d410c0337ad 100644
--- a/src/libcore/at_vec.rs
+++ b/src/libcore/at_vec.rs
@@ -1,7 +1,7 @@
//! Managed vectors
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
use cast::transmute;
@@ -48,7 +48,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
*/
#[inline(always)]
pub pure fn build_sized(size: uint,
- builder: &fn(push: pure fn(+v: A))) -> @[A] {
+ builder: &fn(push: pure fn(v: A))) -> @[A] {
let mut vec: @[const A] = @[];
unsafe { raw::reserve(&mut vec, size); }
builder(|+x| unsafe { raw::push(&mut vec, move x) });
@@ -66,7 +66,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
* onto the vector being constructed.
*/
#[inline(always)]
-pub pure fn build(builder: &fn(push: pure fn(+v: A))) -> @[A] {
+pub pure fn build(builder: &fn(push: pure fn(v: A))) -> @[A] {
build_sized(4, builder)
}
@@ -83,8 +83,8 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
* onto the vector being constructed.
*/
#[inline(always)]
-pub pure fn build_sized_opt(+size: Option,
- builder: &fn(push: pure fn(+v: A))) -> @[A] {
+pub pure fn build_sized_opt(size: Option,
+ builder: &fn(push: pure fn(v: A))) -> @[A] {
build_sized(size.get_default(4), builder)
}
@@ -126,7 +126,7 @@ fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
* Creates an immutable vector of size `n_elts` and initializes the elements
* to the value `t`.
*/
-pub pure fn from_elem(n_elts: uint, +t: T) -> @[T] {
+pub pure fn from_elem(n_elts: uint, t: T) -> @[T] {
do build_sized(n_elts) |push| {
let mut i: uint = 0u;
while i < n_elts { push(copy t); i += 1u; }
@@ -166,7 +166,7 @@ pub unsafe fn set_len(v: @[const T], new_len: uint) {
}
#[inline(always)]
- pub unsafe fn push(v: &mut @[const T], +initval: T) {
+ pub unsafe fn push(v: &mut @[const T], initval: T) {
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
let fill = (**repr).unboxed.fill;
if (**repr).unboxed.alloc > fill {
@@ -178,7 +178,7 @@ pub unsafe fn push(v: &mut @[const T], +initval: T) {
}
// This doesn't bother to make sure we have space.
#[inline(always)] // really pretty please
- pub unsafe fn push_fast(v: &mut @[const T], +initval: T) {
+ pub unsafe fn push_fast(v: &mut @[const T], initval: T) {
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
let fill = (**repr).unboxed.fill;
(**repr).unboxed.fill += sys::size_of::();
@@ -187,7 +187,7 @@ pub unsafe fn push_fast(v: &mut @[const T], +initval: T) {
rusti::move_val_init(*p, move initval);
}
- pub unsafe fn push_slow(v: &mut @[const T], +initval: T) {
+ pub unsafe fn push_slow(v: &mut @[const T], initval: T) {
reserve_at_least(v, v.len() + 1u);
push_fast(v, move initval);
}
diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs
index 21f5861b89e7..f4f0d7b61044 100644
--- a/src/libcore/cast.rs
+++ b/src/libcore/cast.rs
@@ -21,7 +21,7 @@ pub unsafe fn reinterpret_cast(src: &T) -> U {
* reinterpret_cast on managed pointer types.
*/
#[inline(always)]
-pub unsafe fn forget(+thing: T) { rusti::forget(move thing); }
+pub unsafe fn forget(thing: T) { rusti::forget(move thing); }
/**
* Force-increment the reference count on a shared box. If used
@@ -29,7 +29,7 @@ pub unsafe fn reinterpret_cast(src: &T) -> U {
* and/or reinterpret_cast when such calls would otherwise scramble a box's
* reference count
*/
-pub unsafe fn bump_box_refcount(+t: @T) { forget(move t); }
+pub unsafe fn bump_box_refcount(t: @T) { forget(move t); }
/**
* Transform a value of one type into a value of another type.
@@ -40,7 +40,7 @@ pub unsafe fn reinterpret_cast(src: &T) -> U {
* assert transmute("L") == ~[76u8, 0u8];
*/
#[inline(always)]
-pub unsafe fn transmute(+thing: L) -> G {
+pub unsafe fn transmute(thing: L) -> G {
let newthing: G = reinterpret_cast(&thing);
forget(move thing);
move newthing
@@ -48,33 +48,33 @@ pub unsafe fn transmute(+thing: L) -> G {
/// Coerce an immutable reference to be mutable.
#[inline(always)]
-pub unsafe fn transmute_mut(+ptr: &a/T) -> &a/mut T { transmute(move ptr) }
+pub unsafe fn transmute_mut(ptr: &a/T) -> &a/mut T { transmute(move ptr) }
/// Coerce a mutable reference to be immutable.
#[inline(always)]
-pub unsafe fn transmute_immut(+ptr: &a/mut T) -> &a/T {
+pub unsafe fn transmute_immut(ptr: &a/mut T) -> &a/T {
transmute(move ptr)
}
/// Coerce a borrowed pointer to have an arbitrary associated region.
#[inline(always)]
-pub unsafe fn transmute_region(+ptr: &a/T) -> &b/T { transmute(move ptr) }
+pub unsafe fn transmute_region(ptr: &a/T) -> &b/T { transmute(move ptr) }
/// Coerce an immutable reference to be mutable.
#[inline(always)]
-pub unsafe fn transmute_mut_unsafe(+ptr: *const T) -> *mut T {
+pub unsafe fn transmute_mut_unsafe(ptr: *const T) -> *mut T {
transmute(ptr)
}
/// Coerce an immutable reference to be mutable.
#[inline(always)]
-pub unsafe fn transmute_immut_unsafe(+ptr: *const T) -> *T {
+pub unsafe fn transmute_immut_unsafe(ptr: *const T) -> *T {
transmute(ptr)
}
/// Coerce a borrowed mutable pointer to have an arbitrary associated region.
#[inline(always)]
-pub unsafe fn transmute_mut_region(+ptr: &a/mut T) -> &b/mut T {
+pub unsafe fn transmute_mut_region(ptr: &a/mut T) -> &b/mut T {
transmute(move ptr)
}
diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs
index ff9f9498a985..64c38d13e493 100644
--- a/src/libcore/comm.rs
+++ b/src/libcore/comm.rs
@@ -32,8 +32,8 @@
*/
-// NB: transitionary, de-mode-ing.
-#[warn(deprecated_mode)];
+// NB: transitionary, de-mode-ing
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
use either::Either;
@@ -75,7 +75,7 @@ pub fn Port() -> Port {
impl Port {
fn chan() -> Chan { Chan(self) }
- fn send(+v: T) { self.chan().send(move v) }
+ fn send(v: T) { self.chan().send(move v) }
fn recv() -> T { recv(self) }
fn peek() -> bool { peek(self) }
@@ -84,7 +84,7 @@ fn peek() -> bool { peek(self) }
impl Chan {
fn chan() -> Chan { self }
- fn send(+v: T) { send(self, move v) }
+ fn send(v: T) { send(self, move v) }
fn recv() -> T { recv_chan(self) }
fn peek() -> bool { peek_chan(self) }
@@ -174,7 +174,7 @@ pub fn Chan(&&p: Port) -> Chan {
* Sends data over a channel. The sent data is moved into the channel,
* whereupon the caller loses access to it.
*/
-pub fn send(ch: Chan, +data: T) {
+pub fn send(ch: Chan, data: T) {
let Chan_(p) = ch;
let data_ptr = ptr::addr_of(&data) as *();
let res = rustrt::rust_port_id_send(p, data_ptr);
diff --git a/src/libcore/dlist.rs b/src/libcore/dlist.rs
index 4e08dd4c2f36..17ddd6ea73b7 100644
--- a/src/libcore/dlist.rs
+++ b/src/libcore/dlist.rs
@@ -9,7 +9,7 @@
*/
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
type DListLink = Option>;
@@ -80,7 +80,7 @@ impl DListNode {
}
/// Creates a new dlist node with the given data.
-pure fn new_dlist_node(+data: T) -> DListNode {
+pure fn new_dlist_node(data: T) -> DListNode {
DListNode(@{data: move data, mut linked: false,
mut prev: None, mut next: None})
}
@@ -91,13 +91,13 @@ impl DListNode {
}
/// Creates a new dlist with a single element
-pub pure fn from_elem(+data: T) -> DList {
+pub pure fn from_elem(data: T) -> DList {
let list = DList();
unsafe { list.push(move data); }
list
}
-pub fn from_vec(+vec: &[T]) -> DList {
+pub fn from_vec(vec: &[T]) -> DList {
do vec::foldl(DList(), vec) |list,data| {
list.push(*data); // Iterating left-to-right -- add newly to the tail.
list
@@ -115,7 +115,7 @@ fn concat(lists: DList>) -> DList {
}
priv impl DList {
- pure fn new_link(+data: T) -> DListLink {
+ pure fn new_link(data: T) -> DListLink {
Some(DListNode(@{data: move data, mut linked: true,
mut prev: None, mut next: None}))
}
@@ -142,7 +142,7 @@ fn make_mine(nobe: DListNode) {
// Link two nodes together. If either of them are 'none', also sets
// the head and/or tail pointers appropriately.
#[inline(always)]
- fn link(+before: DListLink, +after: DListLink) {
+ fn link(before: DListLink, after: DListLink) {
match before {
Some(neighbour) => neighbour.next = after,
None => self.hd = after
@@ -163,12 +163,12 @@ fn unlink(nobe: DListNode) {
self.size -= 1;
}
- fn add_head(+nobe: DListLink) {
+ fn add_head(nobe: DListLink) {
self.link(nobe, self.hd); // Might set tail too.
self.hd = nobe;
self.size += 1;
}
- fn add_tail(+nobe: DListLink) {
+ fn add_tail(nobe: DListLink) {
self.link(self.tl, nobe); // Might set head too.
self.tl = nobe;
self.size += 1;
@@ -198,27 +198,27 @@ impl DList {
pure fn is_not_empty() -> bool { self.len() != 0 }
/// Add data to the head of the list. O(1).
- fn push_head(+data: T) {
+ fn push_head(data: T) {
self.add_head(self.new_link(move data));
}
/**
* Add data to the head of the list, and get the new containing
* node. O(1).
*/
- fn push_head_n(+data: T) -> DListNode {
+ fn push_head_n(data: T) -> DListNode {
let mut nobe = self.new_link(move data);
self.add_head(nobe);
option::get(&nobe)
}
/// Add data to the tail of the list. O(1).
- fn push(+data: T) {
+ fn push(data: T) {
self.add_tail(self.new_link(move data));
}
/**
* Add data to the tail of the list, and get the new containing
* node. O(1).
*/
- fn push_n(+data: T) -> DListNode {
+ fn push_n(data: T) -> DListNode {
let mut nobe = self.new_link(move data);
self.add_tail(nobe);
option::get(&nobe)
@@ -227,7 +227,7 @@ fn push_n(+data: T) -> DListNode {
* Insert data into the middle of the list, left of the given node.
* O(1).
*/
- fn insert_before(+data: T, neighbour: DListNode) {
+ fn insert_before(data: T, neighbour: DListNode) {
self.insert_left(self.new_link(move data), neighbour);
}
/**
@@ -242,7 +242,7 @@ fn insert_n_before(nobe: DListNode, neighbour: DListNode) {
* Insert data in the middle of the list, left of the given node,
* and get its containing node. O(1).
*/
- fn insert_before_n(+data: T, neighbour: DListNode) -> DListNode {
+ fn insert_before_n(data: T, neighbour: DListNode) -> DListNode {
let mut nobe = self.new_link(move data);
self.insert_left(nobe, neighbour);
option::get(&nobe)
@@ -251,7 +251,7 @@ fn insert_before_n(+data: T, neighbour: DListNode) -> DListNode {
* Insert data into the middle of the list, right of the given node.
* O(1).
*/
- fn insert_after(+data: T, neighbour: DListNode) {
+ fn insert_after(data: T, neighbour: DListNode) {
self.insert_right(neighbour, self.new_link(move data));
}
/**
@@ -266,7 +266,7 @@ fn insert_n_after(nobe: DListNode, neighbour: DListNode) {
* Insert data in the middle of the list, right of the given node,
* and get its containing node. O(1).
*/
- fn insert_after_n(+data: T, neighbour: DListNode) -> DListNode {
+ fn insert_after_n(data: T, neighbour: DListNode) -> DListNode {
let mut nobe = self.new_link(move data);
self.insert_right(neighbour, nobe);
option::get(&nobe)
diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs
index 3ce5a7153fdd..a2a709087971 100644
--- a/src/libcore/dvec.rs
+++ b/src/libcore/dvec.rs
@@ -10,7 +10,7 @@
*/
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
use cast::reinterpret_cast;
@@ -61,17 +61,17 @@ pub fn DVec() -> DVec {
}
/// Creates a new dvec with a single element
-pub fn from_elem(+e: A) -> DVec {
+pub fn from_elem(e: A) -> DVec {
DVec_({mut data: ~[move e]})
}
/// Creates a new dvec with the contents of a vector
-pub fn from_vec(+v: ~[A]) -> DVec {
+pub fn from_vec(v: ~[A]) -> DVec {
DVec_({mut data: move v})
}
/// Consumes the vector and returns its contents
-pub fn unwrap(+d: DVec) -> ~[A] {
+pub fn unwrap(d: DVec) -> ~[A] {
let DVec_({data: v}) <- d;
move v
}
@@ -87,7 +87,7 @@ pub fn unwrap(+d: DVec) -> ~[A] {
}
#[inline(always)]
- fn check_out(f: &fn(+v: ~[A]) -> B) -> B {
+ fn check_out(f: &fn(v: ~[A]) -> B) -> B {
unsafe {
let mut data = cast::reinterpret_cast(&null::<()>());
data <-> self.data;
@@ -98,7 +98,7 @@ fn check_out(f: &fn(+v: ~[A]) -> B) -> B {
}
#[inline(always)]
- fn give_back(+data: ~[A]) {
+ fn give_back(data: ~[A]) {
unsafe {
self.data = move data;
}
@@ -120,7 +120,7 @@ fn reserve(count: uint) {
* and return a new vector to replace it with.
*/
#[inline(always)]
- fn swap(f: &fn(+v: ~[A]) -> ~[A]) {
+ fn swap(f: &fn(v: ~[A]) -> ~[A]) {
self.check_out(|v| self.give_back(f(move v)))
}
@@ -130,7 +130,7 @@ fn swap(f: &fn(+v: ~[A]) -> ~[A]) {
* and return a new vector to replace it with.
*/
#[inline(always)]
- fn swap_mut(f: &fn(+v: ~[mut A]) -> ~[mut A]) {
+ fn swap_mut(f: &fn(v: ~[mut A]) -> ~[mut A]) {
do self.swap |v| {
vec::from_mut(f(vec::to_mut(move v)))
}
@@ -148,7 +148,7 @@ fn swap_mut(f: &fn(+v: ~[mut A]) -> ~[mut A]) {
}
/// Overwrite the current contents
- fn set(+w: ~[A]) {
+ fn set(w: ~[A]) {
self.check_not_borrowed();
self.data <- w;
}
@@ -164,7 +164,7 @@ fn pop() -> A {
}
/// Insert a single item at the front of the list
- fn unshift(+t: A) {
+ fn unshift(t: A) {
unsafe {
let mut data = cast::reinterpret_cast(&null::<()>());
data <-> self.data;
@@ -178,7 +178,7 @@ fn unshift(+t: A) {
}
/// Append a single item to the end of the list
- fn push(+t: A) {
+ fn push(t: A) {
self.check_not_borrowed();
self.data.push(move t);
}
@@ -295,7 +295,7 @@ fn append_iter>(ts: I) {
}
/// Overwrites the contents of the element at `idx` with `a`
- fn set_elt(idx: uint, +a: A) {
+ fn set_elt(idx: uint, a: A) {
self.check_not_borrowed();
self.data[idx] = a;
}
@@ -305,7 +305,7 @@ fn set_elt(idx: uint, +a: A) {
* growing the vector if necessary. New elements will be initialized
* with `initval`
*/
- fn grow_set_elt(idx: uint, initval: &A, +val: A) {
+ fn grow_set_elt(idx: uint, initval: &A, val: A) {
do self.swap |v| {
let mut v = move v;
v.grow_set(idx, initval, val);
@@ -354,7 +354,7 @@ fn rev_eachi(f: fn(uint, v: &A) -> bool) {
}
impl DVec: Index {
- pure fn index(+idx: uint) -> A {
+ pure fn index(idx: uint) -> A {
self.get_elt(idx)
}
}
diff --git a/src/libcore/either.rs b/src/libcore/either.rs
index dd3bcdfdf881..c64cd25e4813 100644
--- a/src/libcore/either.rs
+++ b/src/libcore/either.rs
@@ -1,5 +1,5 @@
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
//! A type that represents one of two alternatives
@@ -114,7 +114,8 @@ pub fn partition(eithers: &[Either])
match *eith { Right(_) => true, _ => false }
}
-pub pure fn unwrap_left(+eith: Either) -> T {
+// tjc: fix the next two after a snapshot
+pub pure fn unwrap_left(eith: Either) -> T {
//! Retrieves the value in the left branch. Fails if the either is Right.
match move eith {
@@ -122,7 +123,7 @@ pub fn partition(eithers: &[Either])
}
}
-pub pure fn unwrap_right(+eith: Either) -> U {
+pub pure fn unwrap_right(eith: Either) -> U {
//! Retrieves the value in the right branch. Fails if the either is Left.
match move eith {
diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs
index 25f92e617260..e10ff4bac714 100644
--- a/src/libcore/extfmt.rs
+++ b/src/libcore/extfmt.rs
@@ -87,7 +87,7 @@ fn parse_fmt_string(s: &str, error: ErrorFn) -> ~[Piece] {
let mut pieces: ~[Piece] = ~[];
let lim = str::len(s);
let mut buf = ~"";
- fn flush_buf(+buf: ~str, pieces: &mut ~[Piece]) -> ~str {
+ fn flush_buf(buf: ~str, pieces: &mut ~[Piece]) -> ~str {
if buf.len() > 0 {
let piece = PieceString(move buf);
pieces.push(move piece);
@@ -323,7 +323,7 @@ enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
let mut s = str::from_char(c);
return unsafe { pad(cv, s, PadNozero) };
}
- pure fn conv_str(cv: Conv, +s: &str) -> ~str {
+ pure fn conv_str(cv: Conv, s: &str) -> ~str {
// For strings, precision is the maximum characters
// displayed
let mut unpadded = match cv.precision {
@@ -405,7 +405,7 @@ impl PadMode : Eq {
pure fn ne(other: &PadMode) -> bool { !self.eq(other) }
}
- fn pad(cv: Conv, +s: ~str, mode: PadMode) -> ~str {
+ fn pad(cv: Conv, s: ~str, mode: PadMode) -> ~str {
let mut s = move s; // sadtimes
let uwidth : uint = match cv.width {
CountImplied => return s,
@@ -518,7 +518,7 @@ enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
let mut s = str::from_char(c);
return unsafe { pad(cv, s, PadNozero) };
}
- pure fn conv_str(cv: Conv, +s: &str) -> ~str {
+ pure fn conv_str(cv: Conv, s: &str) -> ~str {
// For strings, precision is the maximum characters
// displayed
let mut unpadded = match cv.precision {
@@ -600,7 +600,7 @@ impl PadMode : Eq {
pure fn ne(other: &PadMode) -> bool { !self.eq(other) }
}
- fn pad(cv: Conv, +s: ~str, mode: PadMode) -> ~str {
+ fn pad(cv: Conv, s: ~str, mode: PadMode) -> ~str {
let mut s = move s; // sadtimes
let uwidth : uint = match cv.width {
CountImplied => return s,
diff --git a/src/libcore/future.rs b/src/libcore/future.rs
index db311ea3e823..11b6a2c01354 100644
--- a/src/libcore/future.rs
+++ b/src/libcore/future.rs
@@ -1,5 +1,5 @@
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
/*!
@@ -55,7 +55,7 @@ fn with(blk: fn((&A)) -> B) -> B {
}
}
-pub fn from_value(+val: A) -> Future {
+pub fn from_value(val: A) -> Future {
/*!
* Create a future from a value
*
@@ -66,7 +66,7 @@ pub fn from_value(+val: A) -> Future {
Future {state: Forced(~(move val))}
}
-pub fn from_port(+port: future_pipe::client::waiting) ->
+pub fn from_port(port: future_pipe::client::waiting) ->
Future {
/*!
* Create a future from a port
diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs
index ddd262050007..6942d38d5d34 100644
--- a/src/libcore/int-template.rs
+++ b/src/libcore/int-template.rs
@@ -1,5 +1,5 @@
// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
use T = inst::T;
@@ -231,7 +231,7 @@ fn test_to_str() {
#[test]
fn test_interfaces() {
- fn test(+ten: U) {
+ fn test(ten: U) {
assert (ten.to_int() == 10);
let two: U = from_int(2);
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index f8f644a17ab8..2efc96933da8 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -813,7 +813,7 @@ pub struct Res {
}
}
- pub fn Res(+arg: Arg) -> Res{
+ pub fn Res(arg: Arg) -> Res{
Res {
arg: move arg
}
@@ -822,17 +822,17 @@ pub fn Res(+arg: Arg) -> Res{
pub type Arg = {
val: t,
opt_level: Option,
- fsync_fn: fn@(+f: t, Level) -> int
+ fsync_fn: fn@(f: t, Level) -> int
};
// fsync file after executing blk
// FIXME (#2004) find better way to create resources within lifetime of
// outer res
pub fn FILE_res_sync(file: &FILERes, opt_level: Option,
- blk: fn(+v: Res<*libc::FILE>)) {
+ blk: fn(v: Res<*libc::FILE>)) {
blk(move Res({
val: file.f, opt_level: opt_level,
- fsync_fn: fn@(+file: *libc::FILE, l: Level) -> int {
+ fsync_fn: fn@(file: *libc::FILE, l: Level) -> int {
return os::fsync_fd(libc::fileno(file), l) as int;
}
}));
@@ -840,10 +840,10 @@ pub fn FILE_res_sync(file: &FILERes, opt_level: Option,
// fsync fd after executing blk
pub fn fd_res_sync(fd: &FdRes, opt_level: Option,
- blk: fn(+v: Res)) {
+ blk: fn(v: Res)) {
blk(move Res({
val: fd.fd, opt_level: opt_level,
- fsync_fn: fn@(+fd: fd_t, l: Level) -> int {
+ fsync_fn: fn@(fd: fd_t, l: Level) -> int {
return os::fsync_fd(fd, l) as int;
}
}));
@@ -853,11 +853,11 @@ pub fn fd_res_sync(fd: &FdRes, opt_level: Option,
pub trait FSyncable { fn fsync(l: Level) -> int; }
// Call o.fsync after executing blk
- pub fn obj_sync(+o: FSyncable, opt_level: Option,
- blk: fn(+v: Res)) {
+ pub fn obj_sync(o: FSyncable, opt_level: Option,
+ blk: fn(v: Res)) {
blk(Res({
val: o, opt_level: opt_level,
- fsync_fn: fn@(+o: FSyncable, l: Level) -> int {
+ fsync_fn: fn@(o: FSyncable, l: Level) -> int {
return o.fsync(l);
}
}));
diff --git a/src/libcore/iter-trait.rs b/src/libcore/iter-trait.rs
index a2fb4698d7c7..09bfe2eff36a 100644
--- a/src/libcore/iter-trait.rs
+++ b/src/libcore/iter-trait.rs
@@ -16,7 +16,7 @@ impl IMPL_T: iter::ExtendedIter {
pure fn eachi(blk: fn(uint, v: &A) -> bool) { iter::eachi(&self, blk) }
pure fn all(blk: fn(&A) -> bool) -> bool { iter::all(&self, blk) }
pure fn any(blk: fn(&A) -> bool) -> bool { iter::any(&self, blk) }
- pure fn foldl(+b0: B, blk: fn(&B, &A) -> B) -> B {
+ pure fn foldl(b0: B, blk: fn(&B, &A) -> B) -> B {
iter::foldl(&self, move b0, blk)
}
pure fn position(f: fn(&A) -> bool) -> Option {
@@ -30,20 +30,20 @@ impl IMPL_T: iter::EqIter {
}
impl IMPL_T: iter::CopyableIter {
- pure fn filter_to_vec(pred: fn(+a: A) -> bool) -> ~[A] {
+ pure fn filter_to_vec(pred: fn(a: A) -> bool) -> ~[A] {
iter::filter_to_vec(&self, pred)
}
- pure fn map_to_vec(op: fn(+v: A) -> B) -> ~[B] {
+ pure fn map_to_vec(op: fn(v: A) -> B) -> ~[B] {
iter::map_to_vec(&self, op)
}
pure fn to_vec() -> ~[A] { iter::to_vec(&self) }
- pure fn flat_map_to_vec>(op: fn(+a: A) -> IB)
+ pure fn flat_map_to_vec>(op: fn(a: A) -> IB)
-> ~[B] {
iter::flat_map_to_vec(&self, op)
}
- pure fn find(p: fn(+a: A) -> bool) -> Option { iter::find(&self, p) }
+ pure fn find(p: fn(a: A) -> bool) -> Option { iter::find(&self, p) }
}
impl IMPL_T: iter::CopyableOrderedIter {
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 5271555d299f..bf3e91f70719 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -18,7 +18,7 @@ pub trait ExtendedIter {
pure fn eachi(blk: fn(uint, v: &A) -> bool);
pure fn all(blk: fn(&A) -> bool) -> bool;
pure fn any(blk: fn(&A) -> bool) -> bool;
- pure fn foldl(+b0: B, blk: fn(&B, &A) -> B) -> B;
+ pure fn foldl(b0: B, blk: fn(&B, &A) -> B) -> B;
pure fn position(f: fn(&A) -> bool) -> Option;
}
@@ -36,10 +36,10 @@ pub trait TimesIx{
}
pub trait CopyableIter {
- pure fn filter_to_vec(pred: fn(+a: A) -> bool) -> ~[A];
- pure fn map_to_vec(op: fn(+v: A) -> B) -> ~[B];
+ pure fn filter_to_vec(pred: fn(a: A) -> bool) -> ~[A];
+ pure fn map_to_vec(op: fn(v: A) -> B) -> ~[B];
pure fn to_vec() -> ~[A];
- pure fn find(p: fn(+a: A) -> bool) -> Option;
+ pure fn find(p: fn(a: A) -> bool) -> Option;
}
pub trait CopyableOrderedIter {
@@ -64,7 +64,7 @@ pub trait Buildable {
* onto the sequence being constructed.
*/
static pure fn build_sized(size: uint,
- builder: fn(push: pure fn(+v: A))) -> self;
+ builder: fn(push: pure fn(v: A))) -> self;
}
pub pure fn eachi>(self: &IA,
@@ -93,7 +93,7 @@ pub trait Buildable {
}
pub pure fn filter_to_vec>(
- self: &IA, prd: fn(+a: A) -> bool) -> ~[A] {
+ self: &IA, prd: fn(a: A) -> bool) -> ~[A] {
do vec::build_sized_opt(self.size_hint()) |push| {
for self.each |a| {
if prd(*a) { push(*a); }
@@ -102,7 +102,7 @@ pub trait Buildable {
}
pub pure fn map_to_vec>(self: &IA,
- op: fn(+v: A) -> B)
+ op: fn(v: A) -> B)
-> ~[B] {
do vec::build_sized_opt(self.size_hint()) |push| {
for self.each |a| {
@@ -112,8 +112,7 @@ pub trait Buildable {
}
pub pure fn flat_map_to_vec,IB:BaseIter>(
- self: &IA, op: fn(+a: A) -> IB) -> ~[B] {
-
+ self: &IA, op: fn(a: A) -> IB) -> ~[B] {
do vec::build |push| {
for self.each |a| {
for op(*a).each |b| {
@@ -123,7 +122,7 @@ pub trait Buildable {
}
}
-pub pure fn foldl>(self: &IA, +b0: B,
+pub pure fn foldl>(self: &IA, b0: B,
blk: fn(&B, &A) -> B)
-> B {
let mut b <- b0;
@@ -206,7 +205,7 @@ pub trait Buildable {
}
pub pure fn find>(self: &IA,
- p: fn(+a: A) -> bool) -> Option {
+ p: fn(a: A) -> bool) -> Option {
for self.each |i| {
if p(*i) { return Some(*i) }
}
@@ -226,7 +225,7 @@ pub trait Buildable {
* onto the sequence being constructed.
*/
#[inline(always)]
-pub pure fn build>(builder: fn(push: pure fn(+v: A)))
+pub pure fn build>(builder: fn(push: pure fn(v: A)))
-> B {
build_sized(4, builder)
}
@@ -247,7 +246,7 @@ pub trait Buildable {
#[inline(always)]
pub pure fn build_sized_opt>(
size: Option,
- builder: fn(push: pure fn(+v: A))) -> B {
+ builder: fn(push: pure fn(v: A))) -> B {
build_sized(size.get_default(4), builder)
}
@@ -285,7 +284,7 @@ pub fn map,U,BU: Buildable>(v: &IT, f: fn(&T) -> U)
* to the value `t`.
*/
pub pure fn from_elem>(n_elts: uint,
- +t: T) -> BT {
+ t: T) -> BT {
do build_sized(n_elts) |push| {
let mut i: uint = 0;
while i < n_elts { push(t); i += 1; }
diff --git a/src/libcore/mutable.rs b/src/libcore/mutable.rs
index a1f65117ecfb..5948c630cd85 100644
--- a/src/libcore/mutable.rs
+++ b/src/libcore/mutable.rs
@@ -8,8 +8,7 @@
mutation when the data structure should be immutable.
*/
-
-#[forbid(deprecated_mode)];
+// tjc: re-forbid deprecated modes after snapshot
#[forbid(deprecated_pattern)];
use util::with;
@@ -24,11 +23,11 @@ struct Data {
pub type Mut = Data;
-pub fn Mut(+t: T) -> Mut {
+pub fn Mut(t: T) -> Mut {
Data {value: t, mode: ReadOnly}
}
-pub fn unwrap(+m: Mut) -> T {
+pub fn unwrap(m: Mut) -> T {
// Borrowck should prevent us from calling unwrap while the value
// is in use, as that would be a move from a borrowed value.
assert (m.mode as uint) == (ReadOnly as uint);
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 994e010e4525..038c117b8bed 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -77,6 +77,6 @@ pub trait Shr {
#[lang="index"]
pub trait Index {
- pure fn index(+index: Index) -> Result;
+ pure fn index(index: Index) -> Result;
}
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 87d6aeefbc35..6bd326186cb4 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -49,7 +49,7 @@ pub enum Option {
}
}
-pub pure fn expect(opt: &Option, +reason: ~str) -> T {
+pub pure fn expect(opt: &Option, reason: ~str) -> T {
/*!
* Gets the value out of an option, printing a specified message on
* failure
@@ -67,8 +67,8 @@ pub enum Option {
match *opt { Some(ref x) => Some(f(x)), None => None }
}
-pub pure fn map_consume(+opt: Option,
- f: fn(+v: T) -> U) -> Option {
+pub pure fn map_consume(opt: Option,
+ f: fn(v: T) -> U) -> Option {
/*!
* As `map`, but consumes the option and gives `f` ownership to avoid
* copying.
@@ -76,8 +76,8 @@ pub enum Option {
if opt.is_some() { Some(f(option::unwrap(move opt))) } else { None }
}
-pub pure fn chain(+opt: Option,
- f: fn(+t: T) -> Option) -> Option {
+pub pure fn chain(opt: Option,
+ f: fn(t: T) -> Option) -> Option {
/*!
* Update an optional value by optionally running its content through a
* function that returns an option.
@@ -101,7 +101,7 @@ pub enum Option {
match *opt { Some(ref x) => f(x), None => None }
}
-pub pure fn or(+opta: Option, +optb: Option) -> Option {
+pub pure fn or(opta: Option, optb: Option) -> Option {
/*!
* Returns the leftmost some() value, or none if both are none.
*/
@@ -112,7 +112,7 @@ pub enum Option {
}
#[inline(always)]
-pub pure fn while_some(+x: Option, blk: fn(+v: T) -> Option) {
+pub pure fn while_some(x: Option, blk: fn(v: T) -> Option) {
//! Applies a function zero or more times until the result is none.
let mut opt <- x;
@@ -133,13 +133,13 @@ pub enum Option {
!is_none(opt)
}
-pub pure fn get_default(opt: &Option, +def: T) -> T {
+pub pure fn get_default(opt: &Option