about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-02 11:37:37 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-02 14:31:39 -0700
commitf78cdcb6364cf938bfeb71da0c7eca62e257d537 (patch)
treecb3f93224e4757b5f77709e576ca6f24ce0981ec /src/libstd
parenta5042d58ee86af13b6910fa1884b7c1fe9423ae7 (diff)
downloadrust-f78cdcb6364cf938bfeb71da0c7eca62e257d537.tar.gz
rust-f78cdcb6364cf938bfeb71da0c7eca62e257d537.zip
Removing explicit uses of + mode
This removes most explicit uses of the + argument mode. Pending a
snapshot, I had to remove the forbid(deprecated_modes) pragma from
a bunch of files. I'll put it back!

+ mode still has to be used in a few places for functions that get
moved (see task.rs)

The changes outside core and std are due to the to_bytes trait and
making the compiler (with legacy modes on) agree with the libraries
(with legacy modes off) about modes.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/getopts.rs2
-rw-r--r--src/libstd/net_tcp.rs8
-rw-r--r--src/libstd/net_url.rs2
-rw-r--r--src/libstd/rope.rs4
-rw-r--r--src/libstd/std.rc3
5 files changed, 11 insertions, 8 deletions
diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs
index a04eadb7732..67bbff7fb6a 100644
--- a/src/libstd/getopts.rs
+++ b/src/libstd/getopts.rs
@@ -232,7 +232,7 @@ type Result = result::Result<Matches, Fail_>;
  */
 fn getopts(args: &[~str], opts: &[Opt]) -> Result unsafe {
     let n_opts = vec::len::<Opt>(opts);
-    fn f(_x: uint) -> ~[Optval] { return ~[]; }
+    fn f(+_x: uint) -> ~[Optval] { return ~[]; }
     let vals = vec::to_mut(vec::from_fn(n_opts, f));
     let mut free: ~[~str] = ~[];
     let l = vec::len(args);
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs
index aedd53d41cc..59cb0d36f77 100644
--- a/src/libstd/net_tcp.rs
+++ b/src/libstd/net_tcp.rs
@@ -763,7 +763,7 @@ impl TcpSocket {
 
 /// Implementation of `io::reader` trait for a buffered `net::tcp::tcp_socket`
 impl TcpSocketBuf: io::Reader {
-    fn read(buf: &[mut u8], len: uint) -> uint {
+    fn read(buf: &[mut u8], +len: uint) -> uint {
         // Loop until our buffer has enough data in it for us to read from.
         while self.data.buf.len() < len {
             let read_result = read(&self.data.sock, 0u);
@@ -799,13 +799,13 @@ impl TcpSocketBuf: io::Reader {
         let mut bytes = ~[0];
         if self.read(bytes, 1u) == 0 { fail } else { bytes[0] as int }
     }
-    fn unread_byte(amt: int) {
+    fn unread_byte(+amt: int) {
         self.data.buf.unshift(amt as u8);
     }
     fn eof() -> bool {
         false // noop
     }
-    fn seek(dist: int, seek: io::SeekStyle) {
+    fn seek(+dist: int, +seek: io::SeekStyle) {
         log(debug, fmt!("tcp_socket_buf seek stub %? %?", dist, seek));
         // noop
     }
@@ -827,7 +827,7 @@ impl TcpSocketBuf: io::Writer {
                              err_data.err_name, err_data.err_msg));
         }
     }
-    fn seek(dist: int, seek: io::SeekStyle) {
+    fn seek(+dist: int, +seek: io::SeekStyle) {
       log(debug, fmt!("tcp_socket_buf seek stub %? %?", dist, seek));
         // noop
     }
diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs
index 00226c4e81e..920751d690f 100644
--- a/src/libstd/net_url.rs
+++ b/src/libstd/net_url.rs
@@ -735,7 +735,7 @@ impl Url : Eq {
 }
 
 impl Url: IterBytes {
-    pure fn iter_bytes(lsb0: bool, f: to_bytes::Cb) {
+    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
         unsafe { self.to_str() }.iter_bytes(lsb0, f)
     }
 }
diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs
index 647560099e9..d14a4854555 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(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(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/std.rc b/src/libstd/std.rc
index aa26c4af29c..95af018e35a 100644
--- a/src/libstd/std.rc
+++ b/src/libstd/std.rc
@@ -18,6 +18,9 @@ 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)];