]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Don't accept `as Trait` anymore; fix all occurrences of it.
authorPatrick Walton <pcwalton@mimiga.net>
Tue, 12 Mar 2013 20:00:50 +0000 (13:00 -0700)
committerPatrick Walton <pcwalton@mimiga.net>
Thu, 14 Mar 2013 03:07:09 +0000 (20:07 -0700)
101 files changed:
doc/rust.md
src/libcore/flate.rs
src/libcore/hashmap.rs
src/libcore/io.rs
src/libcore/os.rs
src/libcore/rand.rs
src/libcore/repr.rs
src/libcore/run.rs
src/libcore/task/local_data_priv.rs
src/libcore/unstable/at_exit.rs
src/libfuzzer/fuzzer.rc
src/librustc/driver/driver.rs
src/librustc/driver/session.rs
src/librustc/front/config.rs
src/librustc/front/intrinsic.rs
src/librustc/front/test.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/metadata/loader.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/liveness.rs
src/librustc/middle/trans/cabi_x86_64.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/trans/foreign.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/vtable.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/rscope.rs
src/librusti/rusti.rc
src/librustpkg/util.rs
src/libstd/bitv.rs
src/libstd/ebml.rs
src/libstd/flatpipes.rs
src/libstd/json.rs
src/libstd/net_tcp.rs
src/libstd/oldmap.rs
src/libstd/prettyprint.rs
src/libstd/semver.rs
src/libstd/sort.rs
src/libstd/tempfile.rs
src/libstd/term.rs
src/libstd/test.rs
src/libstd/timer.rs
src/libstd/treemap.rs
src/libsyntax/ast_map.rs
src/libsyntax/attr.rs
src/libsyntax/diagnostic.rs
src/libsyntax/ext/asm.rs
src/libsyntax/ext/auto_encode.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/build.rs
src/libsyntax/ext/concat_idents.rs
src/libsyntax/ext/deriving.rs
src/libsyntax/ext/env.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/fmt.rs
src/libsyntax/ext/log_syntax.rs
src/libsyntax/ext/pipes/ast_builder.rs
src/libsyntax/ext/pipes/check.rs
src/libsyntax/ext/pipes/liveness.rs
src/libsyntax/ext/pipes/mod.rs
src/libsyntax/ext/pipes/pipec.rs
src/libsyntax/ext/pipes/proto.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/trace_macros.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/fold.rs
src/libsyntax/parse/comments.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/lexer.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/test/auxiliary/issue-2380.rs
src/test/compile-fail/class-cast-to-trait.rs
src/test/compile-fail/kindck-owned-trait-contains.rs
src/test/compile-fail/kindck-owned-trait-scoped.rs
src/test/compile-fail/kindck-owned-trait.rs
src/test/compile-fail/map-types.rs
src/test/compile-fail/regions-bounds.rs
src/test/compile-fail/regions-infer-paramd-method.rs
src/test/compile-fail/regions-trait-1.rs
src/test/compile-fail/regions-trait-2.rs
src/test/compile-fail/regions-trait-3.rs
src/test/compile-fail/tps-invariant-trait.rs
src/test/compile-fail/trait-test-2.rs
src/test/compile-fail/vtable-res-trait-param.rs
src/test/run-pass/issue-2288.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2935.rs
src/test/run-pass/kindck-owned-trait-contains-1.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs
src/test/run-pass/regions-trait.rs

index 72e4beff7de37ccebe7e71f363e46189acef272e..aaf49c5ca9839888b16ec1f56d282da6c377f54c 100644 (file)
@@ -1227,7 +1227,7 @@ to pointers to the trait name, used as a type.
 # impl Shape for int { }
 # let mycircle = 0;
 
-let myshape: Shape = @mycircle as @Shape;
+let myshape: @Shape = @mycircle as @Shape;
 ~~~~
 
 The resulting value is a managed box containing the value that was cast,
index f9348ae5380736cf1150d245cb676f985f5e937b..c830648e9dffef6f13888392f1a7f2f9221b2394 100644 (file)
@@ -17,6 +17,7 @@
 use libc;
 use libc::{c_void, size_t, c_int};
 use ptr;
+use rand::RngUtil;
 use vec;
 
 #[cfg(test)] use rand;
index 2adcee495a738e8fbe69cbb3ee0dbcea41b78b3c..931866999c408a44bb1bbce84e7547bd0dae6fce 100644 (file)
@@ -20,6 +20,7 @@ pub mod linear {
     use hash::Hash;
     use iter;
     use option::{None, Option, Some};
+    use rand::RngUtil;
     use rand;
     use uint;
     use vec;
index a9dfecfe9b15e83fd05235e2fbdc01354e32d1fa..4942b0587851b4422fdfab370d42666f1c43c4a7 100644 (file)
@@ -785,8 +785,7 @@ pub fn fd_writer(fd: fd_t, cleanup: bool) -> @Writer {
 
 
 pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
-    -> Result<Writer, ~str> {
-
+                   -> Result<@Writer, ~str> {
     #[cfg(windows)]
     fn wb() -> c_int {
       (O_WRONLY | libc::consts::os::extra::O_BINARY) as c_int
@@ -1079,22 +1078,24 @@ fn write_i8(&self, n: i8) { self.write([n as u8]) }
 }
 
 #[allow(non_implicitly_copyable_typarams)]
-pub fn file_writer(path: &Path, flags: &[FileFlag]) -> Result<Writer, ~str> {
+pub fn file_writer(path: &Path, flags: &[FileFlag]) -> Result<@Writer, ~str> {
     mk_file_writer(path, flags).chain(|w| result::Ok(w))
 }
 
 
 // FIXME: fileflags // #2004
-pub fn buffered_file_writer(path: &Path) -> Result<Writer, ~str> {
+pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
     unsafe {
         let f = do os::as_c_charp(path.to_str()) |pathbuf| {
             do os::as_c_charp("w") |modebuf| {
                 libc::fopen(pathbuf, modebuf)
             }
         };
-        return if f as uint == 0u { result::Err(~"error opening "
-                                                + path.to_str()) }
-        else { result::Ok(FILE_writer(f, true)) }
+        return if f as uint == 0u {
+            result::Err(~"error opening " + path.to_str())
+        } else {
+            result::Ok(FILE_writer(f, true))
+        }
     }
 }
 
@@ -1142,14 +1143,14 @@ fn get_type(&self) -> WriterType { File }
     BytesWriter { bytes: ~[], mut pos: 0u }
 }
 
-pub pure fn with_bytes_writer(f: &fn(Writer)) -> ~[u8] {
+pub pure fn with_bytes_writer(f: &fn(@Writer)) -> ~[u8] {
     let wr = @BytesWriter();
-    f(wr as Writer);
+    f(wr as @Writer);
     let @BytesWriter{bytes, _} = wr;
     return bytes;
 }
 
-pub pure fn with_str_writer(f: &fn(Writer)) -> ~str {
+pub pure fn with_str_writer(f: &fn(@Writer)) -> ~str {
     let mut v = with_bytes_writer(f);
 
     // FIXME (#3758): This should not be needed.
@@ -1277,8 +1278,8 @@ pub fn fd_res_sync(fd: &FdRes, opt_level: Option<Level>,
     pub trait FSyncable { fn fsync(&self, l: Level) -> int; }
 
     // Call o.fsync after executing blk
-    pub fn obj_sync(o: FSyncable, opt_level: Option<Level>,
-                    blk: &fn(v: Res<FSyncable>)) {
+    pub fn obj_sync(o: @FSyncable, opt_level: Option<Level>,
+                    blk: &fn(v: Res<@FSyncable>)) {
         blk(Res(Arg {
             val: o, opt_level: opt_level,
             fsync_fn: |o, l| o.fsync(l)
@@ -1305,12 +1306,12 @@ fn test_simple() {
             ~"A hoopy frood who really knows where his towel is.";
         debug!(copy frood);
         {
-            let out: io::Writer =
+            let out: @io::Writer =
                 result::get(
                     &io::file_writer(tmpfile, ~[io::Create, io::Truncate]));
             out.write_str(frood);
         }
-        let inp: io::Reader = result::get(&io::file_reader(tmpfile));
+        let inp: @io::Reader = result::get(&io::file_reader(tmpfile));
         let frood2: ~str = inp.read_c_str();
         debug!(copy frood2);
         fail_unless!(frood == frood2);
index 86ea7a491fc63c3cc7df3cc9efe9a358f05a8721..746c403c7bfbaded1129c02e35b5c4dc0faeca81 100644 (file)
@@ -1265,6 +1265,7 @@ mod tests {
     use os::{remove_file, setenv};
     use os;
     use path::Path;
+    use rand::RngUtil;
     use rand;
     use run;
     use str;
@@ -1282,7 +1283,7 @@ pub fn test_args() {
     }
 
     fn make_rand_name() -> ~str {
-        let rng: rand::Rng = rand::Rng();
+        let rng: @rand::Rng = rand::Rng();
         let n = ~"TEST" + rng.gen_str(10u);
         fail_unless!(getenv(n).is_none());
         n
index 7668513a3ca70c63bb954d100546c17915e89ec6..4cb5e58b73331855e22e44002f2db3b03429ba01 100644 (file)
 
 /// A type that can be randomly generated using an RNG
 pub trait Rand {
-    static fn rand(rng: rand::Rng) -> Self;
+    static fn rand(rng: @rand::Rng) -> Self;
 }
 
 impl Rand for int {
-    static fn rand(rng: rand::Rng) -> int {
+    static fn rand(rng: @rand::Rng) -> int {
         rng.gen_int()
     }
 }
 
 impl Rand for i8 {
-    static fn rand(rng: rand::Rng) -> i8 {
+    static fn rand(rng: @rand::Rng) -> i8 {
         rng.gen_i8()
     }
 }
 
 impl Rand for i16 {
-    static fn rand(rng: rand::Rng) -> i16 {
+    static fn rand(rng: @rand::Rng) -> i16 {
         rng.gen_i16()
     }
 }
 
 impl Rand for i32 {
-    static fn rand(rng: rand::Rng) -> i32 {
+    static fn rand(rng: @rand::Rng) -> i32 {
         rng.gen_i32()
     }
 }
 
 impl Rand for i64 {
-    static fn rand(rng: rand::Rng) -> i64 {
+    static fn rand(rng: @rand::Rng) -> i64 {
         rng.gen_i64()
     }
 }
 
 impl Rand for u8 {
-    static fn rand(rng: rand::Rng) -> u8 {
+    static fn rand(rng: @rand::Rng) -> u8 {
         rng.gen_u8()
     }
 }
 
 impl Rand for u16 {
-    static fn rand(rng: rand::Rng) -> u16 {
+    static fn rand(rng: @rand::Rng) -> u16 {
         rng.gen_u16()
     }
 }
 
 impl Rand for u32 {
-    static fn rand(rng: rand::Rng) -> u32 {
+    static fn rand(rng: @rand::Rng) -> u32 {
         rng.gen_u32()
     }
 }
 
 impl Rand for u64 {
-    static fn rand(rng: rand::Rng) -> u64 {
+    static fn rand(rng: @rand::Rng) -> u64 {
         rng.gen_u64()
     }
 }
 
 impl Rand for float {
-    static fn rand(rng: rand::Rng) -> float {
+    static fn rand(rng: @rand::Rng) -> float {
         rng.gen_float()
     }
 }
 
 impl Rand for f32 {
-    static fn rand(rng: rand::Rng) -> f32 {
+    static fn rand(rng: @rand::Rng) -> f32 {
         rng.gen_f32()
     }
 }
 
 impl Rand for f64 {
-    static fn rand(rng: rand::Rng) -> f64 {
+    static fn rand(rng: @rand::Rng) -> f64 {
         rng.gen_f64()
     }
 }
 
 impl Rand for char {
-    static fn rand(rng: rand::Rng) -> char {
+    static fn rand(rng: @rand::Rng) -> char {
         rng.gen_char()
     }
 }
 
 impl Rand for bool {
-    static fn rand(rng: rand::Rng) -> bool {
+    static fn rand(rng: @rand::Rng) -> bool {
         rng.gen_bool()
     }
 }
 
 impl<T:Rand> Rand for Option<T> {
-    static fn rand(rng: rand::Rng) -> Option<T> {
-        if rng.gen_bool() { Some(Rand::rand(rng)) }
-        else { None }
+    static fn rand(rng: @rand::Rng) -> Option<T> {
+        if rng.gen_bool() {
+            Some(Rand::rand(rng))
+        } else {
+            None
+        }
     }
 }
 
@@ -145,8 +148,83 @@ pub struct Weighted<T> {
     item: T,
 }
 
+pub trait RngUtil {
+    fn gen<T:Rand>(&self) -> T;
+    /// Return a random int
+    fn gen_int(&self) -> int;
+    fn gen_int_range(&self, start: int, end: int) -> int;
+    /// Return a random i8
+    fn gen_i8(&self) -> i8;
+    /// Return a random i16
+    fn gen_i16(&self) -> i16;
+    /// Return a random i32
+    fn gen_i32(&self) -> i32;
+    /// Return a random i64
+    fn gen_i64(&self) -> i64;
+    /// Return a random uint
+    fn gen_uint(&self) -> uint;
+    /**
+     * Return a uint randomly chosen from the range [start, end),
+     * failing if start >= end
+     */
+    fn gen_uint_range(&self, start: uint, end: uint) -> uint;
+    /// Return a random u8
+    fn gen_u8(&self) -> u8;
+    /// Return a random u16
+    fn gen_u16(&self) -> u16;
+    /// Return a random u32
+    fn gen_u32(&self) -> u32;
+    /// Return a random u64
+    fn gen_u64(&self) -> u64;
+    /// Return a random float in the interval [0,1]
+    fn gen_float(&self) -> float;
+    /// Return a random f32 in the interval [0,1]
+    fn gen_f32(&self) -> f32;
+    /// Return a random f64 in the interval [0,1]
+    fn gen_f64(&self) -> f64;
+    /// Return a random char
+    fn gen_char(&self) -> char;
+    /**
+     * Return a char randomly chosen from chars, failing if chars is empty
+     */
+    fn gen_char_from(&self, chars: &str) -> char;
+    /// Return a random bool
+    fn gen_bool(&self) -> bool;
+    /// Return a bool with a 1 in n chance of true
+    fn gen_weighted_bool(&self, n: uint) -> bool;
+    /**
+     * Return a random string of the specified length composed of A-Z,a-z,0-9
+     */
+    fn gen_str(&self, len: uint) -> ~str;
+    /// Return a random byte string of the specified length
+    fn gen_bytes(&self, len: uint) -> ~[u8];
+    /// Choose an item randomly, failing if values is empty
+    fn choose<T:Copy>(&self, values: &[T]) -> T;
+    /// Choose Some(item) randomly, returning None if values is empty
+    fn choose_option<T:Copy>(&self, values: &[T]) -> Option<T>;
+    /**
+     * Choose an item respecting the relative weights, failing if the sum of
+     * the weights is 0
+     */
+    fn choose_weighted<T:Copy>(&self, v : &[Weighted<T>]) -> T;
+    /**
+     * Choose Some(item) respecting the relative weights, returning none if
+     * the sum of the weights is 0
+     */
+    fn choose_weighted_option<T:Copy>(&self, v: &[Weighted<T>]) -> Option<T>;
+    /**
+     * Return a vec containing copies of the items, in order, where
+     * the weight of the item determines how many copies there are
+     */
+    fn weighted_vec<T:Copy>(&self, v: &[Weighted<T>]) -> ~[T];
+    /// Shuffle a vec
+    fn shuffle<T:Copy>(&self, values: &[T]) -> ~[T];
+    /// Shuffle a mutable vec in place
+    fn shuffle_mut<T>(&self, values: &mut [T]);
+}
+
 /// Extension methods for random number generators
-pub impl Rng {
+impl RngUtil for @Rng {
     /// Return a random value for a Rand type
     fn gen<T:Rand>(&self) -> T {
         Rand::rand(*self)
@@ -407,7 +485,7 @@ pub fn seed() -> ~[u8] {
 }
 
 /// Create a random number generator with a system specified seed
-pub fn Rng() -> Rng {
+pub fn Rng() -> @Rng {
     seeded_rng(seed())
 }
 
@@ -449,7 +527,7 @@ fn next(&self) -> u32 {
     }
 }
 
-pub pure fn xorshift() -> Rng {
+pub pure fn xorshift() -> @Rng {
     // constants taken from http://en.wikipedia.org/wiki/Xorshift
     seeded_xorshift(123456789u32, 362436069u32, 521288629u32, 88675123u32)
 }
@@ -467,7 +545,7 @@ fn tls_rng_state(_v: @RandRes) {}
  * seeded by the system. Intended to be used in method chaining style, ie
  * task_rng().gen_int().
  */
-pub fn task_rng() -> Rng {
+pub fn task_rng() -> @Rng {
     let r : Option<@RandRes>;
     unsafe {
         r = task::local_data::local_data_get(tls_rng_state);
index ad85c5e5ceff4b6f0587c41f8f4a9cc568174e12..e6a4a99df4419b2ed97f3edf46673e95acad0489 100644 (file)
@@ -41,7 +41,7 @@ trait EscapedCharWriter {
     fn write_escaped_char(&self, ch: char);
 }
 
-impl EscapedCharWriter for Writer {
+impl EscapedCharWriter for @Writer {
     fn write_escaped_char(&self, ch: char) {
         match ch {
             '\t' => self.write_str("\\t"),
index 0d027ba116321e6a2c02d2f5fb6ac6f206d8f3f9..d3affbc69fe910b30eb550f72c62d9bb9faa1b4c 100644 (file)
@@ -45,13 +45,13 @@ pub trait Program {
     fn get_id(&mut self) -> pid_t;
 
     /// Returns an io::writer that can be used to write to stdin
-    fn input(&mut self) -> io::Writer;
+    fn input(&mut self) -> @io::Writer;
 
     /// Returns an io::reader that can be used to read from stdout
-    fn output(&mut self) -> io::Reader;
+    fn output(&mut self) -> @io::Reader;
 
     /// Returns an io::reader that can be used to read from stderr
-    fn err(&mut self) -> io::Reader;
+    fn err(&mut self) -> @io::Reader;
 
     /// Closes the handle to the child processes standard input
     fn close_input(&mut self);
@@ -207,7 +207,7 @@ pub fn run_program(prog: &str, args: &[~str]) -> int {
  *
  * A class with a <program> field
  */
-pub fn start_program(prog: &str, args: &[~str]) -> Program {
+pub fn start_program(prog: &str, args: &[~str]) -> @Program {
     let pipe_input = os::pipe();
     let pipe_output = os::pipe();
     let pipe_err = os::pipe();
@@ -274,13 +274,13 @@ fn ProgRes(r: ProgRepr) -> ProgRes {
 
     impl Program for ProgRes {
         fn get_id(&mut self) -> pid_t { return self.r.pid; }
-        fn input(&mut self) -> io::Writer {
+        fn input(&mut self) -> @io::Writer {
             io::fd_writer(self.r.in_fd, false)
         }
-        fn output(&mut self) -> io::Reader {
+        fn output(&mut self) -> @io::Reader {
             io::FILE_reader(self.r.out_file, false)
         }
-        fn err(&mut self) -> io::Reader {
+        fn err(&mut self) -> @io::Reader {
             io::FILE_reader(self.r.err_file, false)
         }
         fn close_input(&mut self) { close_repr_input(&mut self.r); }
index bb05520e1a363a44328104514430023fd153319f..6a933ef515f1fb48af2bdc877a1824b4a40e6986 100644 (file)
@@ -23,7 +23,7 @@
 pub trait LocalData { }
 impl<T:Durable> LocalData for @T { }
 
-impl Eq for LocalData {
+impl Eq for @LocalData {
     pure fn eq(&self, other: &@LocalData) -> bool {
         unsafe {
             let ptr_a: (uint, uint) = cast::reinterpret_cast(&(*self));
@@ -36,7 +36,7 @@ impl Eq for LocalData {
 
 // If TLS is used heavily in future, this could be made more efficient with a
 // proper map.
-type TaskLocalElement = (*libc::c_void, *libc::c_void, LocalData);
+type TaskLocalElement = (*libc::c_void, *libc::c_void, @LocalData);
 // Has to be a pointer at outermost layer; the foreign call returns void *.
 type TaskLocalMap = @mut ~[Option<TaskLocalElement>];
 
index f878161eca19cfec838b76c4b3b9257c6aa177ab..99ba5030f83b0cca6a93ed99418218d2bf85e94f 100644 (file)
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use sys;
 use cast;
+use libc::{c_void, size_t};
+use rand::RngUtil;
+use rand;
+use sys;
 use task;
 use vec;
-use rand;
-use libc::{c_void, size_t};
 
 #[cfg(test)] use uint;
 
index b1379b9ab36ab079fbb1dcd92b73ebd86e9c11d8..ce554f3473163ab22859526e22a1a7cd74efc915 100644 (file)
@@ -202,10 +202,13 @@ pub fn replace_expr_in_crate(crate: ast::crate, i: uint,
                              newexpr: ast::expr, tm: test_mode) ->
    ast::crate {
     let j: @mut uint = @mut 0u;
-    fn fold_expr_rep(j_: @mut uint, i_: uint, newexpr_: ast::expr_,
-                     original: &ast::expr_, fld: fold::ast_fold,
-                     tm_: test_mode) ->
-       ast::expr_ {
+    fn fold_expr_rep(j_: @mut uint,
+                     i_: uint,
+                     newexpr_: ast::expr_,
+                     original: &ast::expr_,
+                     fld: @fold::ast_fold,
+                     tm_: test_mode)
+                  -> ast::expr_ {
         *j_ += 1u;
         if i_ + 1u == *j_ && safe_to_replace_expr(original, tm_) {
             newexpr_
@@ -229,10 +232,13 @@ pub fn replace_expr_in_crate(crate: ast::crate, i: uint,
 pub fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::Ty,
                            tm: test_mode) -> ast::crate {
     let j: @mut uint = @mut 0u;
-    fn fold_ty_rep(j_: @mut uint, i_: uint, newty_: ast::ty_,
-                   original: &ast::ty_, fld: fold::ast_fold,
-                   tm_: test_mode) ->
-       ast::ty_ {
+    fn fold_ty_rep(j_: @mut uint,
+                   i_: uint,
+                   newty_: ast::ty_,
+                   original: &ast::ty_,
+                   fld: @fold::ast_fold,
+                   tm_: test_mode)
+                -> ast::ty_ {
         *j_ += 1u;
         if i_ + 1u == *j_ && safe_to_replace_ty(original, tm_) {
             newty_
@@ -252,7 +258,7 @@ pub fn under(n: uint, it: &fn(uint)) {
     while i < n { it(i); i += 1u; }
 }
 
-pub fn as_str(f: @fn(+x: io::Writer)) -> ~str {
+pub fn as_str(f: @fn(+x: @io::Writer)) -> ~str {
     io::with_str_writer(f)
 }
 
@@ -304,7 +310,8 @@ pub fn check_variants_T<T: Copy>(
                         diagnostic::mk_span_handler(handler, codemap),
                         crate2,
                         fname,
-                        rdr, a,
+                        rdr,
+                        a,
                         pprust::no_ann(),
                         false))
                 };
index c26b9691dbe61e54e7a335817e2f1d7934c0ae7d..509ef704b070abe9cf537de9ccb52a507de8c7d0 100644 (file)
@@ -681,7 +681,7 @@ pub fn build_session(sopts: @session::options,
 pub fn build_session_(sopts: @session::options,
                       cm: @codemap::CodeMap,
                       demitter: diagnostic::Emitter,
-                      span_diagnostic_handler: diagnostic::span_handler)
+                      span_diagnostic_handler: @diagnostic::span_handler)
                    -> Session {
     let target_cfg = build_target_config(sopts, demitter);
     let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
@@ -870,7 +870,7 @@ pub fn early_error(emitter: diagnostic::Emitter, msg: ~str) -> ! {
     fail!();
 }
 
-pub fn list_metadata(sess: Session, path: &Path, out: io::Writer) {
+pub fn list_metadata(sess: Session, path: &Path, out: @io::Writer) {
     metadata::loader::list_file_metadata(
         sess.parse_sess.interner,
         session::sess_os_to_meta_os(sess.targ_cfg.os), path, out);
index d2d0ceff6331df663477fee8a0012c254e4cd98c..22b4fd36154290fdb4cf0093f1ecdcb6816ce080 100644 (file)
@@ -154,8 +154,8 @@ pub struct Session_ {
     codemap: @codemap::CodeMap,
     // For a library crate, this is always none
     main_fn: @mut Option<(node_id, codemap::span)>,
-    span_diagnostic: diagnostic::span_handler,
-    filesearch: filesearch::FileSearch,
+    span_diagnostic: @diagnostic::span_handler,
+    filesearch: @filesearch::FileSearch,
     building_library: @mut bool,
     working_dir: Path,
     lint_settings: lint::LintSettings
@@ -227,7 +227,7 @@ fn span_lint(&self, lint_mode: lint::lint,
     fn next_node_id(&self) -> ast::node_id {
         return syntax::parse::next_node_id(self.parse_sess);
     }
-    fn diagnostic(&self) -> diagnostic::span_handler {
+    fn diagnostic(&self) -> @diagnostic::span_handler {
         self.span_diagnostic
     }
     fn debugging_opt(&self, opt: uint) -> bool {
index cdf63c49de3a4c6d0f5a367cf2f3e6d6a3751bd8..bb0080ba5357073fd50962f2850746328a5f8223 100644 (file)
@@ -63,7 +63,7 @@ fn filter_view_item(cx: @Context, &&view_item: @ast::view_item
     }
 }
 
-fn fold_mod(cx: @Context, m: &ast::_mod, fld: fold::ast_fold) -> ast::_mod {
+fn fold_mod(cx: @Context, m: &ast::_mod, fld: @fold::ast_fold) -> ast::_mod {
     let filtered_items =
         m.items.filter_mapped(|a| filter_item(cx, *a));
     let filtered_view_items =
@@ -84,7 +84,7 @@ fn filter_foreign_item(cx: @Context, &&item: @ast::foreign_item) ->
 fn fold_foreign_mod(
     cx: @Context,
     nm: &ast::foreign_mod,
-    fld: fold::ast_fold
+    fld: @fold::ast_fold
 ) -> ast::foreign_mod {
     let filtered_items =
         nm.items.filter_mapped(|a| filter_foreign_item(cx, *a));
@@ -99,7 +99,7 @@ fn fold_foreign_mod(
 }
 
 fn fold_item_underscore(cx: @Context, item: &ast::item_,
-                        fld: fold::ast_fold) -> ast::item_ {
+                        fld: @fold::ast_fold) -> ast::item_ {
     let item = match *item {
         ast::item_impl(ref a, b, c, ref methods) => {
             let methods = methods.filtered(|m| method_in_cfg(cx, *m) );
@@ -135,7 +135,7 @@ fn filter_stmt(cx: @Context, &&stmt: @ast::stmt) ->
 fn fold_block(
     cx: @Context,
     b: &ast::blk_,
-    fld: fold::ast_fold
+    fld: @fold::ast_fold
 ) -> ast::blk_ {
     let filtered_stmts =
         b.stmts.filter_mapped(|a| filter_stmt(cx, *a));
index e7ffc6c55cbc564058773dde86a6f48d4b2bdc08..6cfcac3e85a28996be313d58df5f13362d79a4f0 100644 (file)
@@ -128,7 +128,7 @@ pub mod rusti {
         #[abi = "rust-intrinsic"]
         pub extern {
             pub fn get_tydesc<T>() -> *();
-            pub fn visit_tydesc(++td: *TyDesc, &&tv: TyVisitor);
+            pub fn visit_tydesc(++td: *TyDesc, &&tv: @TyVisitor);
         }
     }
 }
index d13993bf5697a3a89bde264f4e2f6929c5f6d4d5..48db758ef42ed002074969a8653ef71745fe81b7 100644 (file)
@@ -39,7 +39,7 @@ struct TestCtxt {
     sess: session::Session,
     crate: @ast::crate,
     path: ~[ast::ident],
-    ext_cx: ext_ctxt,
+    ext_cx: @ext_ctxt,
     testfns: ~[Test]
 }
 
@@ -102,7 +102,7 @@ fn strip_test_functions(crate: @ast::crate) -> @ast::crate {
 
 fn fold_mod(cx: @mut TestCtxt,
             m: &ast::_mod,
-            fld: fold::ast_fold)
+            fld: @fold::ast_fold)
          -> ast::_mod {
     // Remove any #[main] from the AST so it doesn't clash with
     // the one we're going to add. Only if compiling an executable.
@@ -125,7 +125,7 @@ fn nomain(cx: @mut TestCtxt, item: @ast::item) -> @ast::item {
 
 fn fold_crate(cx: @mut TestCtxt,
               c: &ast::crate_,
-              fld: fold::ast_fold)
+              fld: @fold::ast_fold)
            -> ast::crate_ {
     let folded = fold::noop_fold_crate(c, fld);
 
@@ -138,7 +138,7 @@ fn fold_crate(cx: @mut TestCtxt,
 }
 
 
-fn fold_item(cx: @mut TestCtxt, &&i: @ast::item, fld: fold::ast_fold)
+fn fold_item(cx: @mut TestCtxt, &&i: @ast::item, fld: @fold::ast_fold)
           -> Option<@ast::item> {
     cx.path.push(i.ident);
     debug!("current path: %s",
index fa4acea662a83c3303b43b83843614d200f7acae..a9aa5491631aa16c546b33d62598b952809746f0 100644 (file)
 
 // Traverses an AST, reading all the information about use'd crates and extern
 // libraries necessary for later resolving, typechecking, linking, etc.
-pub fn read_crates(diag: span_handler,
+pub fn read_crates(diag: @span_handler,
                    crate: ast::crate,
                    cstore: @mut cstore::CStore,
-                   filesearch: FileSearch,
+                   filesearch: @FileSearch,
                    os: loader::os,
                    statik: bool,
                    intr: @ident_interner) {
@@ -75,7 +75,7 @@ fn dump_crates(crate_cache: @mut ~[cache_entry]) {
 }
 
 fn warn_if_multiple_versions(e: @mut Env,
-                             diag: span_handler,
+                             diag: @span_handler,
                              crate_cache: @mut ~[cache_entry]) {
     use core::either::*;
 
@@ -115,8 +115,8 @@ fn warn_if_multiple_versions(e: @mut Env,
 }
 
 struct Env {
-    diag: span_handler,
-    filesearch: FileSearch,
+    diag: @span_handler,
+    filesearch: @FileSearch,
     cstore: @mut cstore::CStore,
     os: loader::os,
     statik: bool,
index b87418ce7dc8d71c6ad31310a6422a53ac1f2ab6..658b32edf21639547434d6aba32f32c06647f7d1 100644 (file)
@@ -1017,14 +1017,15 @@ fn get_attributes(md: ebml::Doc) -> ~[ast::attribute] {
 }
 
 fn list_meta_items(intr: @ident_interner,
-                   meta_items: ebml::Doc, out: io::Writer) {
+                   meta_items: ebml::Doc,
+                   out: @io::Writer) {
     for get_meta_items(meta_items).each |mi| {
         out.write_str(fmt!("%s\n", pprust::meta_item_to_str(*mi, intr)));
     }
 }
 
 fn list_crate_attributes(intr: @ident_interner, md: ebml::Doc, hash: &str,
-                         out: io::Writer) {
+                         out: @io::Writer) {
     out.write_str(fmt!("=Crate Attributes (%s)=\n", hash));
 
     for get_attributes(md).each |attr| {
@@ -1063,7 +1064,7 @@ fn docstr(doc: ebml::Doc, tag_: uint) -> ~str {
     return deps;
 }
 
-fn list_crate_deps(intr: @ident_interner, data: @~[u8], out: io::Writer) {
+fn list_crate_deps(intr: @ident_interner, data: @~[u8], out: @io::Writer) {
     out.write_str(~"=External Dependencies=\n");
 
     for get_crate_deps(intr, data).each |dep| {
@@ -1106,7 +1107,7 @@ fn iter_crate_items(intr: @ident_interner, cdata: cmd,
 }
 
 pub fn list_crate_metadata(intr: @ident_interner, bytes: @~[u8],
-                           out: io::Writer) {
+                           out: @io::Writer) {
     let hash = get_crate_hash(bytes);
     let md = reader::Doc(bytes);
     list_crate_attributes(intr, md, *hash, out);
index fc42ac2ffedb9c43419ae159b559a10b6efbd2bb..4b1260e76d0d4cc93ec7a16a607ca32f61ae1a1a 100644 (file)
@@ -57,7 +57,7 @@
                                    ii: ast::inlined_item);
 
 pub struct EncodeParams {
-    diag: span_handler,
+    diag: @span_handler,
     tcx: ty::ctxt,
     reachable: HashMap<ast::node_id, ()>,
     reexports2: middle::resolve::ExportMap2,
@@ -83,7 +83,7 @@ struct Stats {
 }
 
 pub struct EncodeContext {
-    diag: span_handler,
+    diag: @span_handler,
     tcx: ty::ctxt,
     stats: @mut Stats,
     reachable: HashMap<ast::node_id, ()>,
@@ -1054,7 +1054,7 @@ fn create_index<T:Copy + Hash + IterBytes>(index: ~[entry<T>]) ->
 }
 
 fn encode_index<T>(ebml_w: writer::Encoder, buckets: ~[@~[entry<T>]],
-                   write_fn: &fn(io::Writer, T)) {
+                   write_fn: &fn(@io::Writer, T)) {
     let writer = ebml_w.writer;
     ebml_w.start_tag(tag_index);
     let mut bucket_locs: ~[uint] = ~[];
@@ -1081,9 +1081,9 @@ fn encode_index<T>(ebml_w: writer::Encoder, buckets: ~[@~[entry<T>]],
     ebml_w.end_tag();
 }
 
-fn write_str(writer: io::Writer, &&s: ~str) { writer.write_str(s); }
+fn write_str(writer: @io::Writer, &&s: ~str) { writer.write_str(s); }
 
-fn write_int(writer: io::Writer, &&n: int) {
+fn write_int(writer: @io::Writer, &&n: int) {
     fail_unless!(n < 0x7fff_ffff);
     writer.write_be_u32(n as u32);
 }
@@ -1326,7 +1326,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
         type_abbrevs: ty::new_ty_hash()
      };
 
-    let ebml_w = writer::Encoder(wr as io::Writer);
+    let ebml_w = writer::Encoder(wr as @io::Writer);
 
     encode_hash(ebml_w, ecx.link_meta.extras_hash);
 
index cd2c26a5ff46c478fe2f6442747f8fb50ac2a61b..02203222e057e77d64748b4de0bc30ebe0e8d3e9 100644 (file)
@@ -37,7 +37,8 @@ pub trait FileSearch {
 
 pub fn mk_filesearch(maybe_sysroot: Option<Path>,
                      target_triple: &str,
-                     +addl_lib_search_paths: ~[Path]) -> FileSearch {
+                     +addl_lib_search_paths: ~[Path])
+                  -> @FileSearch {
     struct FileSearchImpl {
         sysroot: Path,
         addl_lib_search_paths: ~[Path],
@@ -78,7 +79,7 @@ fn get_target_lib_file_path(&self, file: &Path) -> Path {
     } as @FileSearch
 }
 
-pub fn search<T:Copy>(filesearch: FileSearch, pick: pick<T>) -> Option<T> {
+pub fn search<T:Copy>(filesearch: @FileSearch, pick: pick<T>) -> Option<T> {
     let mut rslt = None;
     for filesearch.lib_search_paths().each |lib_search_path| {
         debug!("searching %s", lib_search_path.to_str());
index e9861e1c9ae1209f3d448ee677dbca4185921923..9c61205667750ee459e2bb768037a7fd9c306875 100644 (file)
@@ -44,8 +44,8 @@ pub enum os {
 }
 
 pub struct Context {
-    diag: span_handler,
-    filesearch: FileSearch,
+    diag: @span_handler,
+    filesearch: @FileSearch,
     span: span,
     ident: ast::ident,
     metas: ~[@ast::meta_item],
@@ -87,7 +87,7 @@ fn libname(cx: Context) -> (~str, ~str) {
 fn find_library_crate_aux(
     cx: Context,
     (prefix, suffix): (~str, ~str),
-    filesearch: filesearch::FileSearch
+    filesearch: @filesearch::FileSearch
 ) -> Option<(~str, @~[u8])> {
     let crate_name = crate_name_from_metas(cx.metas);
     let prefix: ~str = prefix + *crate_name + ~"-";
@@ -156,7 +156,8 @@ pub fn crate_name_from_metas(metas: &[@ast::meta_item]) -> @~str {
     }
 }
 
-pub fn note_linkage_attrs(intr: @ident_interner, diag: span_handler,
+pub fn note_linkage_attrs(intr: @ident_interner,
+                          diag: @span_handler,
                           attrs: ~[ast::attribute]) {
     for attr::find_linkage_metas(attrs).each |mi| {
         diag.handler().note(fmt!("meta: %s",
@@ -252,7 +253,9 @@ pub fn meta_section_name(os: os) -> ~str {
 
 // A diagnostic function for dumping crate metadata to an output stream
 pub fn list_file_metadata(intr: @ident_interner,
-                          os: os, path: &Path, out: io::Writer) {
+                          os: os,
+                          path: &Path,
+                          out: @io::Writer) {
     match get_metadata_section(os, path) {
       option::Some(bytes) => decoder::list_crate_metadata(intr, bytes, out),
       option::None => {
index ff24a8891631f06e9da3bc2de2f4157ac7e4e2e8..56a9683762343b5fd3ccc96cdc84eb9ef997d449 100644 (file)
@@ -27,7 +27,7 @@
 use middle::ty::Vid;
 
 pub struct ctxt {
-    diag: span_handler,
+    diag: @span_handler,
     // Def -> str Callback:
     ds: @fn(def_id) -> ~str,
     // The type context.
@@ -57,7 +57,7 @@ fn cx_uses_abbrevs(cx: @ctxt) -> bool {
     }
 }
 
-pub fn enc_ty(w: io::Writer, cx: @ctxt, t: ty::t) {
+pub fn enc_ty(w: @io::Writer, cx: @ctxt, t: ty::t) {
     match cx.abbrevs {
       ac_no_abbrevs => {
         let result_str = match cx.tcx.short_names_cache.find(&t) {
@@ -113,7 +113,7 @@ fn estimate_sz(u: uint) -> uint {
       }
     }
 }
-fn enc_mt(w: io::Writer, cx: @ctxt, mt: ty::mt) {
+fn enc_mt(w: @io::Writer, cx: @ctxt, mt: ty::mt) {
     match mt.mutbl {
       m_imm => (),
       m_mutbl => w.write_char('m'),
@@ -122,7 +122,7 @@ fn enc_mt(w: io::Writer, cx: @ctxt, mt: ty::mt) {
     enc_ty(w, cx, mt.ty);
 }
 
-fn enc_opt<T>(w: io::Writer, t: Option<T>, enc_f: &fn(T)) {
+fn enc_opt<T>(w: @io::Writer, t: Option<T>, enc_f: &fn(T)) {
     match &t {
       &None => w.write_char('n'),
       &Some(ref v) => {
@@ -132,7 +132,7 @@ fn enc_opt<T>(w: io::Writer, t: Option<T>, enc_f: &fn(T)) {
     }
 }
 
-fn enc_substs(w: io::Writer, cx: @ctxt, substs: ty::substs) {
+fn enc_substs(w: @io::Writer, cx: @ctxt, substs: ty::substs) {
     do enc_opt(w, substs.self_r) |r| { enc_region(w, cx, r) }
     do enc_opt(w, substs.self_ty) |t| { enc_ty(w, cx, t) }
     w.write_char('[');
@@ -140,7 +140,7 @@ fn enc_substs(w: io::Writer, cx: @ctxt, substs: ty::substs) {
     w.write_char(']');
 }
 
-fn enc_region(w: io::Writer, cx: @ctxt, r: ty::Region) {
+fn enc_region(w: @io::Writer, cx: @ctxt, r: ty::Region) {
     match r {
       ty::re_bound(br) => {
         w.write_char('b');
@@ -169,7 +169,7 @@ fn enc_region(w: io::Writer, cx: @ctxt, r: ty::Region) {
     }
 }
 
-fn enc_bound_region(w: io::Writer, cx: @ctxt, br: ty::bound_region) {
+fn enc_bound_region(w: @io::Writer, cx: @ctxt, br: ty::bound_region) {
     match br {
       ty::br_self => w.write_char('s'),
       ty::br_anon(idx) => {
@@ -194,7 +194,7 @@ fn enc_bound_region(w: io::Writer, cx: @ctxt, br: ty::bound_region) {
     }
 }
 
-pub fn enc_vstore(w: io::Writer, cx: @ctxt, v: ty::vstore) {
+pub fn enc_vstore(w: @io::Writer, cx: @ctxt, v: ty::vstore) {
     w.write_char('/');
     match v {
       ty::vstore_fixed(u) => {
@@ -214,7 +214,7 @@ pub fn enc_vstore(w: io::Writer, cx: @ctxt, v: ty::vstore) {
     }
 }
 
-pub fn enc_trait_store(w: io::Writer, cx: @ctxt, s: ty::TraitStore) {
+pub fn enc_trait_store(w: @io::Writer, cx: @ctxt, s: ty::TraitStore) {
     match s {
         ty::UniqTraitStore => w.write_char('~'),
         ty::BoxTraitStore => w.write_char('@'),
@@ -226,7 +226,7 @@ pub fn enc_trait_store(w: io::Writer, cx: @ctxt, s: ty::TraitStore) {
     }
 }
 
-fn enc_sty(w: io::Writer, cx: @ctxt, +st: ty::sty) {
+fn enc_sty(w: @io::Writer, cx: @ctxt, +st: ty::sty) {
     match st {
       ty::ty_nil => w.write_char('n'),
       ty::ty_bot => w.write_char('z'),
@@ -337,7 +337,7 @@ fn enc_sty(w: io::Writer, cx: @ctxt, +st: ty::sty) {
     }
 }
 
-fn enc_sigil(w: io::Writer, sigil: Sigil) {
+fn enc_sigil(w: @io::Writer, sigil: Sigil) {
     match sigil {
         ManagedSigil => w.write_str("@"),
         OwnedSigil => w.write_str("~"),
@@ -345,19 +345,19 @@ fn enc_sigil(w: io::Writer, sigil: Sigil) {
     }
 }
 
-pub fn enc_arg(w: io::Writer, cx: @ctxt, arg: ty::arg) {
+pub fn enc_arg(w: @io::Writer, cx: @ctxt, arg: ty::arg) {
     enc_mode(w, cx, arg.mode);
     enc_ty(w, cx, arg.ty);
 }
 
-pub fn enc_mode(w: io::Writer, cx: @ctxt, m: mode) {
+pub fn enc_mode(w: @io::Writer, cx: @ctxt, m: mode) {
     match ty::resolved_mode(cx.tcx, m) {
       by_copy => w.write_char('+'),
       by_ref => w.write_char('='),
     }
 }
 
-fn enc_purity(w: io::Writer, p: purity) {
+fn enc_purity(w: @io::Writer, p: purity) {
     match p {
       pure_fn => w.write_char('p'),
       impure_fn => w.write_char('i'),
@@ -366,26 +366,26 @@ fn enc_purity(w: io::Writer, p: purity) {
     }
 }
 
-fn enc_abi(w: io::Writer, a: Abi) {
+fn enc_abi(w: @io::Writer, a: Abi) {
     match a {
         RustAbi => w.write_char('r'),
     }
 }
 
-fn enc_onceness(w: io::Writer, o: Onceness) {
+fn enc_onceness(w: @io::Writer, o: Onceness) {
     match o {
         Once => w.write_char('o'),
         Many => w.write_char('m')
     }
 }
 
-fn enc_bare_fn_ty(w: io::Writer, cx: @ctxt, ft: &ty::BareFnTy) {
+fn enc_bare_fn_ty(w: @io::Writer, cx: @ctxt, ft: &ty::BareFnTy) {
     enc_purity(w, ft.purity);
     enc_abi(w, ft.abi);
     enc_fn_sig(w, cx, &ft.sig);
 }
 
-fn enc_closure_ty(w: io::Writer, cx: @ctxt, ft: &ty::ClosureTy) {
+fn enc_closure_ty(w: @io::Writer, cx: @ctxt, ft: &ty::ClosureTy) {
     enc_sigil(w, ft.sigil);
     enc_purity(w, ft.purity);
     enc_onceness(w, ft.onceness);
@@ -393,7 +393,7 @@ fn enc_closure_ty(w: io::Writer, cx: @ctxt, ft: &ty::ClosureTy) {
     enc_fn_sig(w, cx, &ft.sig);
 }
 
-fn enc_fn_sig(w: io::Writer, cx: @ctxt, fsig: &ty::FnSig) {
+fn enc_fn_sig(w: @io::Writer, cx: @ctxt, fsig: &ty::FnSig) {
     w.write_char('[');
     for fsig.inputs.each |arg| {
         enc_arg(w, cx, *arg);
@@ -402,7 +402,7 @@ fn enc_fn_sig(w: io::Writer, cx: @ctxt, fsig: &ty::FnSig) {
     enc_ty(w, cx, fsig.output);
 }
 
-pub fn enc_bounds(w: io::Writer, cx: @ctxt, bs: @~[ty::param_bound]) {
+pub fn enc_bounds(w: @io::Writer, cx: @ctxt, bs: @~[ty::param_bound]) {
     for vec::each(*bs) |bound| {
         match *bound {
           ty::bound_owned => w.write_char('S'),
index 98ac67f986b366a677775c29f2b089ca7bb71969..0e98bbe8ffa57244cea431b20d4ae514d09a774c 100644 (file)
@@ -292,7 +292,7 @@ fn encode_ast(ebml_w: writer::Encoder, item: ast::inlined_item) {
 // nested items, as otherwise it would get confused when translating
 // inlined items.
 fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
-    fn drop_nested_items(blk: &ast::blk_, fld: fold::ast_fold) -> ast::blk_ {
+    fn drop_nested_items(blk: &ast::blk_, fld: @fold::ast_fold) -> ast::blk_ {
         let stmts_sans_items = do blk.stmts.filtered |stmt| {
             match stmt.node {
               ast::stmt_expr(_, _) | ast::stmt_semi(_, _) |
index 8c206f2707114e33f3652ec37e4e6cfbfc20bf59..27561e619af57f7d7bb614d0e5a0775ce0c2ecfe 100644 (file)
@@ -825,7 +825,8 @@ fn indices2(&self, ln: LiveNode, succ_ln: LiveNode, op: &fn(uint, uint)) {
         }
     }
 
-    fn write_vars(&self, wr: io::Writer,
+    fn write_vars(&self,
+                  wr: @io::Writer,
                   ln: LiveNode,
                   test: &fn(uint) -> LiveNode) {
         let node_base_idx = self.idx(ln, Variable(0));
index d5877ec563123fa79ad68d98da935897b3ac9f61..f7226812b967a0628d47dbb76ce3a7cf4ab588c3 100644 (file)
@@ -406,6 +406,6 @@ fn compute_info(&self,
     }
 }
 
-pub fn x86_64_abi_info() -> ABIInfo {
+pub fn x86_64_abi_info() -> @ABIInfo {
     return @X86_64_ABIInfo as @ABIInfo;
 }
index 70fc29fd25b47e3bb6e80925e326531dcb7d2270..03806e71ac53747f82094127e33ba12e78ab607d 100644 (file)
@@ -1035,7 +1035,7 @@ pub fn T_captured_tydescs(cx: @CrateContext, n: uint) -> TypeRef {
 
 pub fn T_opaque_trait(cx: @CrateContext, store: ty::TraitStore) -> TypeRef {
     match store {
-        ty::BoxTraitStore | ty::BareTraitStore => {
+        ty::BoxTraitStore => {
             T_struct(~[T_ptr(cx.tydesc_type), T_opaque_box_ptr(cx)])
         }
         ty::UniqTraitStore => {
@@ -1046,6 +1046,9 @@ pub fn T_opaque_trait(cx: @CrateContext, store: ty::TraitStore) -> TypeRef {
         ty::RegionTraitStore(_) => {
             T_struct(~[T_ptr(cx.tydesc_type), T_ptr(T_i8())])
         }
+        ty::BareTraitStore => {
+            cx.sess.bug(~"can't make T_opaque_trait with bare trait store")
+        }
     }
 }
 
index fde1de5b63f21d9ff319c9cbae950b862ec03a67..f6b8e4af6d57f090e7c7292f395b5fab88dbfa84 100644 (file)
@@ -42,7 +42,7 @@
 use syntax::{attr, ast_map};
 use syntax::parse::token::special_idents;
 
-fn abi_info(arch: session::arch) -> cabi::ABIInfo {
+fn abi_info(arch: session::arch) -> @cabi::ABIInfo {
     return match arch {
         arch_x86_64 => x86_64_abi_info(),
         arch_arm => cabi_arm::abi_info(),
index 8d6c6291fdd901fa96041bb47802072436cc6ba0..69e06117785cb6181c098c31ffaf21eed35d750f 100644 (file)
@@ -244,7 +244,7 @@ pub struct InstantiatedTraitRef {
 pub type ctxt = @ctxt_;
 
 struct ctxt_ {
-    diag: syntax::diagnostic::span_handler,
+    diag: @syntax::diagnostic::span_handler,
     interner: HashMap<intern_key, t_box>,
     next_id: @mut uint,
     vecs_implicitly_copyable: bool,
@@ -3600,11 +3600,7 @@ pub fn impl_traits(cx: ctxt, id: ast::def_id, store: TraitStore) -> ~[t] {
     fn storeify(cx: ctxt, ty: t, store: TraitStore) -> t {
         match ty::get(ty).sty {
             ty::ty_trait(did, ref substs, trait_store) => {
-                if store == trait_store ||
-                        (store == BareTraitStore &&
-                         trait_store == BoxTraitStore) ||
-                        (store == BoxTraitStore &&
-                         trait_store == BareTraitStore) {
+                if store == trait_store {
                     ty
                 } else {
                     mk_trait(cx, did, (/*bad*/copy *substs), store)
index 9dda55b3a38cfd556dc633ff5fb2491f85e233d9..61603f7b57824392585887cd139f21411d37f19e 100644 (file)
@@ -218,7 +218,7 @@ fn ast_mt_to_mt<AC:AstConv, RS:region_scope + Copy + Durable>(
 
     // Handle @, ~, and & being able to mean estrs and evecs.
     // If a_seq_ty is a str or a vec, make it an estr/evec.
-    // Also handle function sigils and first-class trait types.
+    // Also handle first-class trait types.
     fn mk_pointer<AC:AstConv,RS:region_scope + Copy + Durable>(
         self: &AC,
         rscope: &RS,
index 17595913f942341d5b964b1ca8596ecbc9c57024..39d769f30f5d81ec739651af9dcb646666ff7f53 100644 (file)
@@ -3204,6 +3204,19 @@ fn arg(m: ast::rmode, ty: ty::t) -> ty::arg {
           fail_unless!(ccx.tcx.intrinsic_defs.contains_key(&ty_visitor_name));
           let (_, tydesc_ty) = tcx.intrinsic_defs.get(&tydesc_name);
           let (_, visitor_trait) = tcx.intrinsic_defs.get(&ty_visitor_name);
+
+          let visitor_trait = match ty::get(visitor_trait).sty {
+            ty::ty_trait(trait_def_id, ref trait_substs, _) => {
+                ty::mk_trait(tcx,
+                             trait_def_id,
+                             copy *trait_substs,
+                             ty::BoxTraitStore)
+            }
+            _ => {
+                tcx.sess.span_bug(it.span, ~"TyVisitor wasn't a trait?!")
+            }
+          };
+
           let td_ptr = ty::mk_ptr(ccx.tcx, ty::mt {ty: tydesc_ty,
                                                    mutbl: ast::m_imm});
           (0u, ~[arg(ast::by_copy, td_ptr),
index de301ead1f84191d4cbf060a3af3bb8578101269..48a37c9e72ad0c7e75fda613b13f39e1ee26f5c8 100644 (file)
@@ -198,12 +198,19 @@ pub fn lookup_vtable(vcx: &VtableContext,
                        vcx.infcx.ty_to_str(ity));
 
                 match ty::get(ity).sty {
-                    ty::ty_trait(idid, _, _) => {
+                    ty::ty_trait(idid, ref isubsts, _) => {
                         if trait_id == idid {
                             debug!("(checking vtable) @0 \
                                     relating ty to trait \
                                     ty with did %?",
                                    idid);
+
+                            // Convert `ity` so that it has the right vstore.
+                            let ity = ty::mk_trait(vcx.tcx(),
+                                                   idid,
+                                                   copy *isubsts,
+                                                   trait_store);
+
                             relate_trait_tys(vcx, location_info,
                                              trait_ty, ity);
                             let vtable = vtable_param(n, n_bound);
@@ -570,7 +577,6 @@ pub fn early_resolve_expr(ex: @ast::expr,
                   match (&ty::get(ty).sty, store) {
                       (&ty::ty_box(mt), ty::BoxTraitStore) |
                       // XXX: Bare trait store is deprecated.
-                      (&ty::ty_box(mt), ty::BareTraitStore) |
                       (&ty::ty_uniq(mt), ty::UniqTraitStore) |
                       (&ty::ty_rptr(_, mt), ty::RegionTraitStore(*)) => {
                           let location_info =
@@ -622,8 +628,14 @@ pub fn early_resolve_expr(ex: @ast::expr,
                           }
                       }
 
-                      // XXX: Remove bare below.
-                      (_, ty::BoxTraitStore) | (_, ty::BareTraitStore) => {
+                      (_, ty::BareTraitStore) => {
+                          fcx.ccx.tcx.sess.span_err(
+                              ex.span,
+                              ~"a sigil (`@`, `~`, or `&`) must be specified \
+                                when casting to a trait");
+                      }
+
+                      (_, ty::BoxTraitStore) => {
                           fcx.ccx.tcx.sess.span_err(
                               ex.span,
                               fmt!("can only cast an @-pointer \
index cfe45aaf3a8155d61dc6770fe822acf308f4af28..3ec4fcb6d2e815cd5d8d9a335f605d98749a9cc4 100644 (file)
@@ -369,12 +369,6 @@ pub fn super_trait_stores<C:Combine>(self: &C,
         }
       }
 
-      // XXX: This should go away soon.
-      (ty::BareTraitStore, ty::BoxTraitStore) |
-      (ty::BoxTraitStore, ty::BareTraitStore) => {
-        Ok(ty::BoxTraitStore)
-      }
-
       _ if a == b => {
         Ok(a)
       }
index f74a0960f66749b9245aba6bb39bc4a28ba57be6..e29e63c41ecca52653dfd88103496b5bdbbbb402 100644 (file)
@@ -125,7 +125,8 @@ pub struct binding_rscope {
 
 pub fn in_binding_rscope<RS:region_scope + Copy + Durable>(self: &RS)
     -> binding_rscope {
-    let base = @(copy *self) as @region_scope;
+    let base = @copy *self;
+    let base = base as @region_scope;
     binding_rscope { base: base, anon_bindings: @mut 0 }
 }
 impl region_scope for binding_rscope {
index 0367a771ffbd17b84462eb6bca4ae9b3b59cde06..182cfc43ade9ea3299f7097524deddb41f69497a 100644 (file)
@@ -59,7 +59,7 @@ enum CmdAction {
 
 /// A utility function that hands off a pretty printer to a callback.
 fn with_pp(intr: @token::ident_interner,
-           cb: &fn(@pprust::ps, io::Writer)) -> ~str {
+           cb: &fn(@pprust::ps, @io::Writer)) -> ~str {
     do io::with_str_writer |writer| {
         let pp = pprust::rust_printer(writer, intr);
 
@@ -257,7 +257,7 @@ fn get_line(prompt: ~str) -> Option<~str> {
 }
 
 /// Run a command, e.g. :clear, :exit, etc.
-fn run_cmd(repl: &mut Repl, _in: io::Reader, _out: io::Writer,
+fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer,
            cmd: ~str, args: ~[~str]) -> CmdAction {
     let mut action = action_none;
     match cmd {
@@ -334,7 +334,7 @@ fn run_cmd(repl: &mut Repl, _in: io::Reader, _out: io::Writer,
 
 /// Executes a line of input, which may either be rust code or a
 /// :command. Returns a new Repl if it has changed.
-fn run_line(repl: &mut Repl, in: io::Reader, out: io::Writer, line: ~str)
+fn run_line(repl: &mut Repl, in: @io::Reader, out: @io::Writer, line: ~str)
     -> Option<Repl> {
     if line.starts_with(~":") {
         let full = line.substr(1, line.len() - 1);
index 7d2b8eccd6c0e2034b43077d205b8bb05dcadbb7..0572cf771dbed4f26a8120e95ea97026dad6e694 100644 (file)
@@ -70,13 +70,14 @@ struct ListenerFn {
 struct ReadyCtx {
     sess: session::Session,
     crate: @ast::crate,
-    ext_cx: ext_ctxt,
+    ext_cx: @ext_ctxt,
     path: ~[ast::ident],
     fns: ~[ListenerFn]
 }
 
-fn fold_mod(_ctx: @mut ReadyCtx, m: &ast::_mod,
-            fold: fold::ast_fold) -> ast::_mod {
+fn fold_mod(_ctx: @mut ReadyCtx,
+            m: &ast::_mod,
+            fold: @fold::ast_fold) -> ast::_mod {
     fn strip_main(item: @ast::item) -> @ast::item {
         @ast::item {
             attrs: do item.attrs.filtered |attr| {
@@ -94,9 +95,9 @@ fn strip_main(item: @ast::item) -> @ast::item {
     }, fold)
 }
 
-fn fold_item(ctx: @mut ReadyCtx, item: @ast::item,
-             fold: fold::ast_fold) -> Option<@ast::item> {
-
+fn fold_item(ctx: @mut ReadyCtx,
+             item: @ast::item,
+             fold: @fold::ast_fold) -> Option<@ast::item> {
     ctx.path.push(item.ident);
 
     let attrs = attr::find_attrs_by_name(item.attrs, ~"pkg_do");
index 8dbdb83698c6f2eb4c80c46e412fd6554e894a68..9cf2d145eacb46730694853a922e75f94b339413 100644 (file)
@@ -1424,7 +1424,7 @@ pub fn test_bitv_remove() {
         fail_unless!(a.capacity() == uint::bits);
     }
 
-    fn rng() -> rand::Rng {
+    fn rng() -> @rand::Rng {
         let seed = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
         rand::seeded_rng(seed)
     }
index a55d4bc97ec560bc0c2a509e7c172c8e08d5e839..4ab119abf1c94b093459f7816d6c4ce1fc65acdb 100644 (file)
@@ -415,11 +415,11 @@ pub mod writer {
 
     // ebml writing
     pub struct Encoder {
-        writer: io::Writer,
+        writer: @io::Writer,
         priv mut size_positions: ~[uint],
     }
 
-    fn write_sized_vuint(w: io::Writer, n: uint, size: uint) {
+    fn write_sized_vuint(w: @io::Writer, n: uint, size: uint) {
         match size {
             1u => w.write(&[0x80u8 | (n as u8)]),
             2u => w.write(&[0x40u8 | ((n >> 8_u) as u8), n as u8]),
@@ -431,7 +431,7 @@ fn write_sized_vuint(w: io::Writer, n: uint, size: uint) {
         };
     }
 
-    fn write_vuint(w: io::Writer, n: uint) {
+    fn write_vuint(w: @io::Writer, n: uint) {
         if n < 0x7f_u { write_sized_vuint(w, n, 1u); return; }
         if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; }
         if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; }
@@ -439,7 +439,7 @@ fn write_vuint(w: io::Writer, n: uint) {
         fail!(fmt!("vint to write too big: %?", n));
     }
 
-    pub fn Encoder(w: io::Writer) -> Encoder {
+    pub fn Encoder(w: @io::Writer) -> Encoder {
         let size_positions: ~[uint] = ~[];
         Encoder { writer: w, mut size_positions: size_positions }
     }
index 897cb4c2034034af04b277db61e96de0379c3bae..e2e09f1d6750a273015ff80b6de62b344103a022 100644 (file)
@@ -459,15 +459,15 @@ pub fn serialize_value<D: Encoder + FromWriter,
     }
 
     pub trait FromReader {
-        static fn from_reader(r: Reader) -> Self;
+        static fn from_reader(r: @Reader) -> Self;
     }
 
     pub trait FromWriter {
-        static fn from_writer(w: Writer) -> Self;
+        static fn from_writer(w: @Writer) -> Self;
     }
 
     impl FromReader for json::Decoder/&self {
-        static fn from_reader(r: Reader) -> json::Decoder/&self {
+        static fn from_reader(r: @Reader) -> json::Decoder/&self {
             match json::from_reader(r) {
                 Ok(json) => {
                     json::Decoder(json)
@@ -478,13 +478,13 @@ impl FromReader for json::Decoder/&self {
     }
 
     impl FromWriter for json::Encoder {
-        static fn from_writer(w: Writer) -> json::Encoder {
+        static fn from_writer(w: @Writer) -> json::Encoder {
             json::Encoder(w)
         }
     }
 
     impl FromReader for ebml::reader::Decoder {
-        static fn from_reader(r: Reader) -> ebml::reader::Decoder {
+        static fn from_reader(r: @Reader) -> ebml::reader::Decoder {
             let buf = @r.read_whole_stream();
             let doc = ebml::reader::Doc(buf);
             ebml::reader::Decoder(doc)
@@ -492,7 +492,7 @@ impl FromReader for ebml::reader::Decoder {
     }
 
     impl FromWriter for ebml::writer::Encoder {
-        static fn from_writer(w: Writer) -> ebml::writer::Encoder {
+        static fn from_writer(w: @Writer) -> ebml::writer::Encoder {
             ebml::writer::Encoder(w)
         }
     }
index 8c6a870b98cd4e3fc3e760f6230a28e07b2e37cc..56f2611c914471ee2bf362705a0fa12dc0350e06 100644 (file)
@@ -74,10 +74,10 @@ fn spaces(n: uint) -> ~str {
 }
 
 pub struct Encoder {
-    priv wr: io::Writer,
+    priv wr: @io::Writer,
 }
 
-pub fn Encoder(wr: io::Writer) -> Encoder {
+pub fn Encoder(wr: @io::Writer) -> Encoder {
     Encoder { wr: wr }
 }
 
@@ -208,11 +208,11 @@ fn emit_tup_elt(&self, idx: uint, f: &fn()) {
 }
 
 pub struct PrettyEncoder {
-    priv wr: io::Writer,
+    priv wr: @io::Writer,
     priv mut indent: uint,
 }
 
-pub fn PrettyEncoder(wr: io::Writer) -> PrettyEncoder {
+pub fn PrettyEncoder(wr: @io::Writer) -> PrettyEncoder {
     PrettyEncoder { wr: wr, indent: 0 }
 }
 
@@ -346,7 +346,7 @@ fn encode(&self, s: &S) {
 }
 
 /// Encodes a json value into a io::writer
-pub fn to_writer(wr: io::Writer, json: &Json) {
+pub fn to_writer(wr: @io::Writer, json: &Json) {
     json.encode(&Encoder(wr))
 }
 
@@ -359,7 +359,7 @@ pub fn to_writer(wr: io::Writer, json: &Json) {
 }
 
 /// Encodes a json value into a io::writer
-pub fn to_pretty_writer(wr: io::Writer, json: &Json) {
+pub fn to_pretty_writer(wr: @io::Writer, json: &Json) {
     json.encode(&PrettyEncoder(wr))
 }
 
@@ -369,14 +369,14 @@ pub fn to_pretty_str(json: &Json) -> ~str {
 }
 
 pub struct Parser {
-    priv rdr: io::Reader,
+    priv rdr: @io::Reader,
     priv mut ch: char,
     priv mut line: uint,
     priv mut col: uint,
 }
 
 /// Decode a json value from an io::reader
-pub fn Parser(rdr: io::Reader) -> Parser {
+pub fn Parser(rdr: @io::Reader) -> Parser {
     Parser {
         rdr: rdr,
         ch: rdr.read_char(),
@@ -734,8 +734,8 @@ fn parse_object(&self) -> Result<Json, Error> {
     }
 }
 
-/// Decodes a json value from an io::reader
-pub fn from_reader(rdr: io::Reader) -> Result<Json, Error> {
+/// Decodes a json value from an @io::Reader
+pub fn from_reader(rdr: @io::Reader) -> Result<Json, Error> {
     Parser(rdr).parse()
 }
 
index 0224927df57ae4e034ca34013f3b26c1b9ddaee6..54fbae956ce5c01f893e1d726c021363bac71da6 100644 (file)
@@ -1799,7 +1799,7 @@ pub fn impl_tcp_socket_impl_reader_handles_eof() {
         let sock_buf = @socket_buf(result::unwrap(conn_result));
         buf_write(sock_buf, expected_req);
 
-        let buf_reader = sock_buf as Reader;
+        let buf_reader = sock_buf as @Reader;
         let actual_response = str::from_bytes(buf_reader.read_whole_stream());
         debug!("Actual response: %s", actual_response);
         fail_unless!(expected_resp == actual_response);
index 18527cfece111499e91d9f77bb64eea449574f11..6a234b9dc9bea514728d29562ed9c40532b6a6dc 100644 (file)
@@ -326,7 +326,7 @@ fn update(&self, key: K, newval: V, ff: &fn(V, V) -> V) -> bool {
     }
 
     pub impl<K:Eq + IterBytes + Hash + Copy + ToStr,V:ToStr + Copy> T<K, V> {
-        fn to_writer(&self, wr: io::Writer) {
+        fn to_writer(&self, wr: @io::Writer) {
             if self.count == 0u {
                 wr.write_str(~"{}");
                 return;
index d2d80eb7da80311f8263e380863b5f02a427f23f..f823d73cf0bfffed435a4b296d7747ff6da600cf 100644 (file)
 use core::io;
 
 pub struct Serializer {
-    wr: io::Writer,
+    wr: @io::Writer,
 }
 
-pub fn Serializer(wr: io::Writer) -> Serializer {
+pub fn Serializer(wr: @io::Writer) -> Serializer {
     Serializer { wr: wr }
 }
 
index 7b8a06f1b93afe42bdaf7d3cd0d365d7a62c2902..85996c8ac4ad46852785c511796579135209a38d 100644 (file)
@@ -138,7 +138,7 @@ impl cmp::Ord for Version {
     bad_parse: () -> ();
 }
 
-fn take_nonempty_prefix(rdr: io::Reader,
+fn take_nonempty_prefix(rdr: @io::Reader,
                         ch: char,
                         pred: &fn(char) -> bool) -> (~str, char) {
     let mut buf = ~"";
@@ -154,7 +154,7 @@ fn take_nonempty_prefix(rdr: io::Reader,
     (buf, ch)
 }
 
-fn take_num(rdr: io::Reader, ch: char) -> (uint, char) {
+fn take_num(rdr: @io::Reader, ch: char) -> (uint, char) {
     let (s, ch) = take_nonempty_prefix(rdr, ch, char::is_digit);
     match uint::from_str(s) {
         None => { bad_parse::cond.raise(()); (0, ch) },
@@ -162,7 +162,7 @@ fn take_num(rdr: io::Reader, ch: char) -> (uint, char) {
     }
 }
 
-fn take_ident(rdr: io::Reader, ch: char) -> (Identifier, char) {
+fn take_ident(rdr: @io::Reader, ch: char) -> (Identifier, char) {
     let (s,ch) = take_nonempty_prefix(rdr, ch, char::is_alphanumeric);
     if s.all(char::is_digit) {
         match uint::from_str(s) {
@@ -180,8 +180,7 @@ fn expect(ch: char, c: char) {
     }
 }
 
-fn parse_reader(rdr: io::Reader) -> Version {
-
+fn parse_reader(rdr: @io::Reader) -> Version {
     let (major, ch) = take_num(rdr, rdr.read_char());
     expect(ch, '.');
     let (minor, ch) = take_num(rdr, rdr.read_char());
index a13617a57ac93b68f7d76292647a1520315f56ef..e0828d981d7254dc01ce81d4935f341b59fad48e 100644 (file)
@@ -893,6 +893,7 @@ mod test_tim_sort {
 
     use sort::tim_sort;
 
+    use core::rand::RngUtil;
     use core::rand;
     use core::vec;
 
@@ -990,6 +991,7 @@ mod big_tests {
 
     use sort::*;
 
+    use core::rand::RngUtil;
     use core::rand;
     use core::task;
     use core::uint;
index cd023962c8846e49347038a975ef272f4a5db454..7704ec158e56545b91b7926d0b7fca9d4090b08d 100644 (file)
@@ -12,6 +12,7 @@
 
 use core::os;
 use core::prelude::*;
+use core::rand::RngUtil;
 use core::rand;
 
 pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option<Path> {
index fb63755a572ee555551a2bd0273dee1f5641e940..2a8c8b3b06bbdf676ce3a06418bd7b4c093377f7 100644 (file)
 pub const color_bright_cyan: u8 = 14u8;
 pub const color_bright_white: u8 = 15u8;
 
-pub fn esc(writer: io::Writer) { writer.write(~[0x1bu8, '[' as u8]); }
+pub fn esc(writer: @io::Writer) { writer.write(~[0x1bu8, '[' as u8]); }
 
 /// Reset the foreground and background colors to default
-pub fn reset(writer: io::Writer) {
+pub fn reset(writer: @io::Writer) {
     esc(writer);
     writer.write(~['0' as u8, 'm' as u8]);
 }
@@ -59,7 +59,7 @@ pub fn color_supported() -> bool {
         };
 }
 
-pub fn set_color(writer: io::Writer, first_char: u8, color: u8) {
+pub fn set_color(writer: @io::Writer, first_char: u8, color: u8) {
     fail_unless!((color < 16u8));
     esc(writer);
     let mut color = color;
@@ -68,12 +68,12 @@ pub fn set_color(writer: io::Writer, first_char: u8, color: u8) {
 }
 
 /// Set the foreground color
-pub fn fg(writer: io::Writer, color: u8) {
+pub fn fg(writer: @io::Writer, color: u8) {
     return set_color(writer, '3' as u8, color);
 }
 
 /// Set the background color
-pub fn bg(writer: io::Writer, color: u8) {
+pub fn bg(writer: @io::Writer, color: u8) {
     return set_color(writer, '4' as u8, color);
 }
 
index 3f363b613d7da9492bf3aa5ea0c3abb74add4bfd..cec9f56708f3483ea1b0c828a04b5a6b1810690b 100644 (file)
@@ -198,8 +198,8 @@ pub struct BenchSamples {
 pub enum TestResult { TrOk, TrFailed, TrIgnored, TrBench(BenchSamples) }
 
 struct ConsoleTestState {
-    out: io::Writer,
-    log_out: Option<io::Writer>,
+    out: @io::Writer,
+    log_out: Option<@io::Writer>,
     use_color: bool,
     mut total: uint,
     mut passed: uint,
@@ -316,7 +316,7 @@ fn fmt_bench_samples(bs: &BenchSamples) -> ~str {
         }
     }
 
-    fn write_log(out: io::Writer, result: TestResult, test: &TestDesc) {
+    fn write_log(out: @io::Writer, result: TestResult, test: &TestDesc) {
         out.write_line(fmt!("%s %s",
                     match result {
                         TrOk => ~"ok",
@@ -326,23 +326,26 @@ fn write_log(out: io::Writer, result: TestResult, test: &TestDesc) {
                     }, test.name.to_str()));
     }
 
-    fn write_ok(out: io::Writer, use_color: bool) {
+    fn write_ok(out: @io::Writer, use_color: bool) {
         write_pretty(out, ~"ok", term::color_green, use_color);
     }
 
-    fn write_failed(out: io::Writer, use_color: bool) {
+    fn write_failed(out: @io::Writer, use_color: bool) {
         write_pretty(out, ~"FAILED", term::color_red, use_color);
     }
 
-    fn write_ignored(out: io::Writer, use_color: bool) {
+    fn write_ignored(out: @io::Writer, use_color: bool) {
         write_pretty(out, ~"ignored", term::color_yellow, use_color);
     }
 
-    fn write_bench(out: io::Writer, use_color: bool) {
+    fn write_bench(out: @io::Writer, use_color: bool) {
         write_pretty(out, ~"bench", term::color_cyan, use_color);
     }
 
-    fn write_pretty(out: io::Writer, word: &str, color: u8, use_color: bool) {
+    fn write_pretty(out: @io::Writer,
+                    word: &str,
+                    color: u8,
+                    use_color: bool) {
         if use_color && term::color_supported() {
             term::fg(out, color);
         }
@@ -601,6 +604,7 @@ pub mod bench {
     use stats::Stats;
 
     use core::num;
+    use core::rand::RngUtil;
     use core::rand;
     use core::u64;
     use core::vec;
@@ -700,7 +704,6 @@ pub fn auto_bench(&mut self, f: &fn(&mut BenchHarness)) -> ~[f64] {
             let mut prev_madp = 0.0;
 
             loop {
-
                 let n_samples = rng.gen_uint_range(50, 60);
                 let n_iter = rng.gen_uint_range(magnitude,
                                                 magnitude * 2);
index 8ed541c7140a2dcb8b33fa4fab3ec1069b539aa9..d72bfe73dd6660f659c7b9aafc7db73f0c1d84da 100644 (file)
@@ -179,6 +179,7 @@ mod test {
     use uv;
 
     use core::iter;
+    use core::rand::RngUtil;
     use core::rand;
     use core::task;
     use core::pipes::{stream, SharedChan};
index 42a84da43d25482ce68826ac87cc01c0991940c6..56ee3bd5893da1a38bd632e543e996f794e08499 100644 (file)
@@ -706,6 +706,7 @@ fn heir_swap<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>,
 mod test_treemap {
     use core::prelude::*;
     use super::*;
+    use core::rand::RngUtil;
     use core::rand;
 
     #[test]
index a97007cfb3a9b9a49682fd30eff4e847c9fee486..5266d1b049a27fc223ffc1cbe2a3cf9020ee3f44 100644 (file)
@@ -110,7 +110,7 @@ pub struct Ctx {
     map: @map,
     path: path,
     local_id: uint,
-    diag: span_handler,
+    diag: @span_handler,
 }
 
 pub type vt = visit::vt<@mut Ctx>;
@@ -132,7 +132,7 @@ pub fn mk_ast_map_visitor() -> vt {
     });
 }
 
-pub fn map_crate(diag: span_handler, c: crate) -> map {
+pub fn map_crate(diag: @span_handler, c: crate) -> map {
     let cx = @mut Ctx {
         map: @std::oldmap::HashMap(),
         path: ~[],
@@ -146,7 +146,7 @@ pub fn map_crate(diag: span_handler, c: crate) -> map {
 // Used for items loaded from external crate that are being inlined into this
 // crate.  The `path` should be the path to the item but should not include
 // the item itself.
-pub fn map_decoded_item(diag: span_handler,
+pub fn map_decoded_item(diag: @span_handler,
                         map: map,
                         +path: path,
                         ii: inlined_item) {
index cd7f9a7cf823e5c6d133302db0fe67147e90c8f5..a410d6cf8e3a241cf0eb383092067b0354f645f1 100644 (file)
@@ -360,7 +360,7 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
 }
 
 
-pub fn require_unique_names(diagnostic: span_handler,
+pub fn require_unique_names(diagnostic: @span_handler,
                             metas: &[@ast::meta_item]) {
     let mut set = LinearSet::new();
     for metas.each |meta| {
index 4e177fecec9e6bacbafb5975fe153940436e4b00..93d28f31c8db424f78bf7e059adf37aea27fe598 100644 (file)
@@ -55,7 +55,7 @@ pub trait span_handler {
     fn span_note(@mut self, sp: span, msg: &str);
     fn span_bug(@mut self, sp: span, msg: &str) -> !;
     fn span_unimpl(@mut self, sp: span, msg: &str) -> !;
-    fn handler(@mut self) -> handler;
+    fn handler(@mut self) -> @handler;
 }
 
 struct HandlerT {
@@ -64,7 +64,7 @@ struct HandlerT {
 }
 
 struct CodemapT {
-    handler: handler,
+    handler: @handler,
     cm: @codemap::CodeMap,
 }
 
@@ -89,7 +89,7 @@ fn span_bug(@mut self, sp: span, msg: &str) -> ! {
     fn span_unimpl(@mut self, sp: span, msg: &str) -> ! {
         self.span_bug(sp, ~"unimplemented " + msg);
     }
-    fn handler(@mut self) -> handler {
+    fn handler(@mut self) -> @handler {
         self.handler
     }
 }
@@ -143,8 +143,8 @@ pub fn ice_msg(msg: &str) -> ~str {
     fmt!("internal compiler error: %s", msg)
 }
 
-pub fn mk_span_handler(handler: handler, cm: @codemap::CodeMap)
-                    -> span_handler {
+pub fn mk_span_handler(handler: @handler, cm: @codemap::CodeMap)
+                    -> @span_handler {
     @mut CodemapT { handler: handler, cm: cm } as @span_handler
 }
 
@@ -304,7 +304,7 @@ fn print_macro_backtrace(cm: @codemap::CodeMap, sp: span) {
     }
 }
 
-pub fn expect<T:Copy>(diag: span_handler,
+pub fn expect<T:Copy>(diag: @span_handler,
                        opt: Option<T>,
                        msg: &fn() -> ~str) -> T {
     match opt {
index 8051a67d8fdc72c74e778556386ca51a87c8dc41..4f2fd68ff95679a428fd4e4fb0d15a9cfa2b0c7d 100644 (file)
@@ -41,10 +41,10 @@ fn next_state(s: State) -> Option<State> {
     }
 }
 
-pub fn expand_asm(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
-    -> base::MacResult {
-
-    let p = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(),
+pub fn expand_asm(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
+               -> base::MacResult {
+    let p = parse::new_parser_from_tts(cx.parse_sess(),
+                                       cx.cfg(),
                                        vec::from_slice(tts));
 
     let mut asm = ~"";
index c99d89776431a9968d9f424aad97e89b03fc6d95..8c02b4323715d40b062f316acedeae1d6edd70fc 100644 (file)
@@ -110,7 +110,7 @@ mod syntax {
 }
 
 pub fn expand_auto_encode(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     _mitem: @ast::meta_item,
     in_items: ~[@ast::item]
@@ -165,7 +165,7 @@ fn filter_attrs(item: @ast::item) -> @ast::item {
 }
 
 pub fn expand_auto_decode(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     _mitem: @ast::meta_item,
     in_items: ~[@ast::item]
@@ -219,7 +219,7 @@ fn filter_attrs(item: @ast::item) -> @ast::item {
     }
 }
 
-priv impl ext_ctxt {
+priv impl @ext_ctxt {
     fn bind_path(
         &self,
         span: span,
@@ -426,7 +426,7 @@ fn lambda_stmts(&self, span: span, +stmts: ~[@ast::stmt]) -> @ast::expr {
 }
 
 fn mk_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     ty_param: ast::TyParam,
@@ -499,7 +499,7 @@ fn mk_impl(
 }
 
 fn mk_ser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     generics: &ast::Generics,
@@ -543,7 +543,7 @@ fn mk_ser_impl(
 }
 
 fn mk_deser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     generics: &ast::Generics,
@@ -587,7 +587,7 @@ fn mk_deser_impl(
 }
 
 fn mk_ser_method(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     +ser_body: ast::blk
 ) -> @ast::method {
@@ -647,7 +647,7 @@ fn mk_ser_method(
 }
 
 fn mk_deser_method(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ty: @ast::Ty,
     +deser_body: ast::blk
@@ -701,7 +701,7 @@ fn mk_deser_method(
 }
 
 fn mk_struct_ser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     fields: &[@ast::struct_field],
@@ -762,7 +762,7 @@ fn mk_struct_ser_impl(
 }
 
 fn mk_struct_deser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     fields: ~[@ast::struct_field],
@@ -866,7 +866,7 @@ fn mk_struct_fields(fields: &[@ast::struct_field]) -> ~[field] {
 }
 
 fn mk_enum_ser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     +enum_def: ast::enum_def,
@@ -883,7 +883,7 @@ fn mk_enum_ser_impl(
 }
 
 fn mk_enum_deser_impl(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     ident: ast::ident,
     +enum_def: ast::enum_def,
@@ -900,7 +900,7 @@ fn mk_enum_deser_impl(
 }
 
 fn ser_variant(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     v_name: ast::ident,
     v_idx: uint,
@@ -982,7 +982,7 @@ fn ser_variant(
 }
 
 fn mk_enum_ser_body(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     name: ast::ident,
     +variants: ~[ast::variant]
@@ -1032,7 +1032,7 @@ fn mk_enum_ser_body(
 }
 
 fn mk_enum_deser_variant_nary(
-    cx: ext_ctxt,
+    cx: @ext_ctxt,
     span: span,
     name: ast::ident,
     args: ~[ast::variant_arg]
@@ -1069,7 +1069,7 @@ fn mk_enum_deser_variant_nary(
 }
 
 fn mk_enum_deser_body(
-    ext_cx: ext_ctxt,
+    ext_cx: @ext_ctxt,
     span: span,
     name: ast::ident,
     variants: ~[ast::variant]
index c8363e3daa8477a9d46779d6192c601b17fde20a..f0822ea4d256a6225bff857074b417c85c527184 100644 (file)
@@ -36,7 +36,7 @@ pub struct MacroDef {
     ext: SyntaxExtension
 }
 
-pub type ItemDecorator = @fn(ext_ctxt,
+pub type ItemDecorator = @fn(@ext_ctxt,
                              span,
                              @ast::meta_item,
                              ~[@ast::item])
@@ -47,7 +47,7 @@ pub struct SyntaxExpanderTT {
     span: Option<span>
 }
 
-pub type SyntaxExpanderTTFun = @fn(ext_ctxt,
+pub type SyntaxExpanderTTFun = @fn(@ext_ctxt,
                                    span,
                                    &[ast::token_tree])
                                 -> MacResult;
@@ -57,7 +57,7 @@ pub struct SyntaxExpanderTTItem {
     span: Option<span>
 }
 
-pub type SyntaxExpanderTTItemFun = @fn(ext_ctxt,
+pub type SyntaxExpanderTTItemFun = @fn(@ext_ctxt,
                                        span,
                                        ast::ident,
                                        ~[ast::token_tree])
@@ -238,8 +238,8 @@ pub trait ext_ctxt {
     fn ident_of(@mut self, st: ~str) -> ast::ident;
 }
 
-pub fn mk_ctxt(parse_sess: @mut parse::ParseSess,
-               +cfg: ast::crate_cfg) -> ext_ctxt {
+pub fn mk_ctxt(parse_sess: @mut parse::ParseSess, +cfg: ast::crate_cfg)
+            -> @ext_ctxt {
     struct CtxtRepr {
         parse_sess: @mut parse::ParseSess,
         cfg: ast::crate_cfg,
@@ -333,7 +333,7 @@ fn ident_of(@mut self, st: ~str) -> ast::ident {
     ((imp) as @ext_ctxt)
 }
 
-pub fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, err_msg: ~str) -> ~str {
+pub fn expr_to_str(cx: @ext_ctxt, expr: @ast::expr, err_msg: ~str) -> ~str {
     match expr.node {
       ast::expr_lit(l) => match l.node {
         ast::lit_str(s) => copy *s,
@@ -343,7 +343,7 @@ pub fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, err_msg: ~str) -> ~str {
     }
 }
 
-pub fn expr_to_ident(cx: ext_ctxt,
+pub fn expr_to_ident(cx: @ext_ctxt,
                      expr: @ast::expr,
                      err_msg: ~str) -> ast::ident {
     match expr.node {
@@ -357,14 +357,14 @@ pub fn expr_to_ident(cx: ext_ctxt,
     }
 }
 
-pub fn check_zero_tts(cx: ext_ctxt, sp: span, tts: &[ast::token_tree],
+pub fn check_zero_tts(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree],
                       name: &str) {
     if tts.len() != 0 {
         cx.span_fatal(sp, fmt!("%s takes no arguments", name));
     }
 }
 
-pub fn get_single_str_from_tts(cx: ext_ctxt,
+pub fn get_single_str_from_tts(cx: @ext_ctxt,
                                sp: span,
                                tts: &[ast::token_tree],
                                name: &str) -> ~str {
@@ -379,7 +379,7 @@ pub fn get_single_str_from_tts(cx: ext_ctxt,
     }
 }
 
-pub fn get_exprs_from_tts(cx: ext_ctxt, tts: &[ast::token_tree])
+pub fn get_exprs_from_tts(cx: @ext_ctxt, tts: &[ast::token_tree])
                        -> ~[@ast::expr] {
     let p = parse::new_parser_from_tts(cx.parse_sess(),
                                        cx.cfg(),
index 5d071b8d517f3a48ba7b6b62e49ab551fe2d8a75..18c7cd3f86138033dbac207e74db1a09741b0aad 100644 (file)
@@ -25,7 +25,7 @@ pub struct Field {
     ex: @ast::expr
 }
 
-pub fn mk_expr(cx: ext_ctxt,
+pub fn mk_expr(cx: @ext_ctxt,
                sp: codemap::span,
                +expr: ast::expr_)
             -> @ast::expr {
@@ -37,28 +37,28 @@ pub fn mk_expr(cx: ext_ctxt,
     }
 }
 
-pub fn mk_lit(cx: ext_ctxt, sp: span, lit: ast::lit_) -> @ast::expr {
+pub fn mk_lit(cx: @ext_ctxt, sp: span, lit: ast::lit_) -> @ast::expr {
     let sp_lit = @codemap::spanned { node: lit, span: sp };
     mk_expr(cx, sp, ast::expr_lit(sp_lit))
 }
-pub fn mk_int(cx: ext_ctxt, sp: span, i: int) -> @ast::expr {
+pub fn mk_int(cx: @ext_ctxt, sp: span, i: int) -> @ast::expr {
     let lit = ast::lit_int(i as i64, ast::ty_i);
     return mk_lit(cx, sp, lit);
 }
-pub fn mk_uint(cx: ext_ctxt, sp: span, u: uint) -> @ast::expr {
+pub fn mk_uint(cx: @ext_ctxt, sp: span, u: uint) -> @ast::expr {
     let lit = ast::lit_uint(u as u64, ast::ty_u);
     return mk_lit(cx, sp, lit);
 }
-pub fn mk_u8(cx: ext_ctxt, sp: span, u: u8) -> @ast::expr {
+pub fn mk_u8(cx: @ext_ctxt, sp: span, u: u8) -> @ast::expr {
     let lit = ast::lit_uint(u as u64, ast::ty_u8);
     return mk_lit(cx, sp, lit);
 }
-pub fn mk_binary(cx: ext_ctxt, sp: span, op: ast::binop,
+pub fn mk_binary(cx: @ext_ctxt, sp: span, op: ast::binop,
                  lhs: @ast::expr, rhs: @ast::expr) -> @ast::expr {
     cx.next_id(); // see ast_util::op_expr_callee_id
     mk_expr(cx, sp, ast::expr_binary(op, lhs, rhs))
 }
-pub fn mk_unary(cx: ext_ctxt, sp: span, op: ast::unop, e: @ast::expr)
+pub fn mk_unary(cx: @ext_ctxt, sp: span, op: ast::unop, e: @ast::expr)
              -> @ast::expr {
     cx.next_id(); // see ast_util::op_expr_callee_id
     mk_expr(cx, sp, ast::expr_unary(op, e))
@@ -88,69 +88,70 @@ pub fn mk_raw_path_global(sp: span, +idents: ~[ast::ident]) -> @ast::path {
                  rp: None,
                  types: ~[] }
 }
-pub fn mk_path(cx: ext_ctxt, sp: span, +idents: ~[ast::ident]) -> @ast::expr {
+pub fn mk_path(cx: @ext_ctxt, sp: span, +idents: ~[ast::ident])
+            -> @ast::expr {
     mk_expr(cx, sp, ast::expr_path(mk_raw_path(sp, idents)))
 }
-pub fn mk_path_global(cx: ext_ctxt, sp: span, +idents: ~[ast::ident])
+pub fn mk_path_global(cx: @ext_ctxt, sp: span, +idents: ~[ast::ident])
                    -> @ast::expr {
     mk_expr(cx, sp, ast::expr_path(mk_raw_path_global(sp, idents)))
 }
-pub fn mk_access_(cx: ext_ctxt, sp: span, p: @ast::expr, m: ast::ident)
+pub fn mk_access_(cx: @ext_ctxt, sp: span, p: @ast::expr, m: ast::ident)
                -> @ast::expr {
     mk_expr(cx, sp, ast::expr_field(p, m, ~[]))
 }
-pub fn mk_access(cx: ext_ctxt, sp: span, +p: ~[ast::ident], m: ast::ident)
+pub fn mk_access(cx: @ext_ctxt, sp: span, +p: ~[ast::ident], m: ast::ident)
               -> @ast::expr {
     let pathexpr = mk_path(cx, sp, p);
     return mk_access_(cx, sp, pathexpr, m);
 }
-pub fn mk_addr_of(cx: ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
+pub fn mk_addr_of(cx: @ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
     return mk_expr(cx, sp, ast::expr_addr_of(ast::m_imm, e));
 }
-pub fn mk_call_(cx: ext_ctxt, sp: span, fn_expr: @ast::expr,
+pub fn mk_call_(cx: @ext_ctxt, sp: span, fn_expr: @ast::expr,
                 +args: ~[@ast::expr]) -> @ast::expr {
     mk_expr(cx, sp, ast::expr_call(fn_expr, args, ast::NoSugar))
 }
-pub fn mk_call(cx: ext_ctxt, sp: span, +fn_path: ~[ast::ident],
+pub fn mk_call(cx: @ext_ctxt, sp: span, +fn_path: ~[ast::ident],
                +args: ~[@ast::expr]) -> @ast::expr {
     let pathexpr = mk_path(cx, sp, fn_path);
     return mk_call_(cx, sp, pathexpr, args);
 }
-pub fn mk_call_global(cx: ext_ctxt, sp: span, +fn_path: ~[ast::ident],
+pub fn mk_call_global(cx: @ext_ctxt, sp: span, +fn_path: ~[ast::ident],
                       +args: ~[@ast::expr]) -> @ast::expr {
     let pathexpr = mk_path_global(cx, sp, fn_path);
     return mk_call_(cx, sp, pathexpr, args);
 }
 // e = expr, t = type
-pub fn mk_base_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
+pub fn mk_base_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                   -> @ast::expr {
     let vecexpr = ast::expr_vec(exprs, ast::m_imm);
     mk_expr(cx, sp, vecexpr)
 }
-pub fn mk_vstore_e(cx: ext_ctxt, sp: span, expr: @ast::expr,
+pub fn mk_vstore_e(cx: @ext_ctxt, sp: span, expr: @ast::expr,
                    vst: ast::expr_vstore) ->
    @ast::expr {
     mk_expr(cx, sp, ast::expr_vstore(expr, vst))
 }
-pub fn mk_uniq_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
+pub fn mk_uniq_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                   -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs), ast::expr_vstore_uniq)
 }
-pub fn mk_slice_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
+pub fn mk_slice_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                    -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs),
                 ast::expr_vstore_slice)
 }
-pub fn mk_fixed_vec_e(cx: ext_ctxt, sp: span, +exprs: ~[@ast::expr])
+pub fn mk_fixed_vec_e(cx: @ext_ctxt, sp: span, +exprs: ~[@ast::expr])
                    -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_vec_e(cx, sp, exprs),
                 ast::expr_vstore_fixed(None))
 }
-pub fn mk_base_str(cx: ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
+pub fn mk_base_str(cx: @ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
     let lit = ast::lit_str(@s);
     return mk_lit(cx, sp, lit);
 }
-pub fn mk_uniq_str(cx: ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
+pub fn mk_uniq_str(cx: @ext_ctxt, sp: span, +s: ~str) -> @ast::expr {
     mk_vstore_e(cx, sp, mk_base_str(cx, sp, s), ast::expr_vstore_uniq)
 }
 pub fn mk_field(sp: span, f: &Field) -> ast::field {
@@ -162,7 +163,7 @@ pub fn mk_field(sp: span, f: &Field) -> ast::field {
 pub fn mk_fields(sp: span, fields: ~[Field]) -> ~[ast::field] {
     fields.map(|f| mk_field(sp, f))
 }
-pub fn mk_struct_e(cx: ext_ctxt,
+pub fn mk_struct_e(cx: @ext_ctxt,
                    sp: span,
                    +ctor_path: ~[ast::ident],
                    +fields: ~[Field])
@@ -172,7 +173,7 @@ pub fn mk_struct_e(cx: ext_ctxt,
                              mk_fields(sp, fields),
                                     option::None::<@ast::expr>))
 }
-pub fn mk_global_struct_e(cx: ext_ctxt,
+pub fn mk_global_struct_e(cx: @ext_ctxt,
                           sp: span,
                           +ctor_path: ~[ast::ident],
                           +fields: ~[Field])
@@ -182,7 +183,7 @@ pub fn mk_global_struct_e(cx: ext_ctxt,
                              mk_fields(sp, fields),
                                     option::None::<@ast::expr>))
 }
-pub fn mk_glob_use(cx: ext_ctxt,
+pub fn mk_glob_use(cx: @ext_ctxt,
                    sp: span,
                    +path: ~[ast::ident]) -> @ast::view_item {
     let glob = @codemap::spanned {
@@ -194,7 +195,7 @@ pub fn mk_glob_use(cx: ext_ctxt,
                       vis: ast::private,
                       span: sp }
 }
-pub fn mk_local(cx: ext_ctxt, sp: span, mutbl: bool,
+pub fn mk_local(cx: @ext_ctxt, sp: span, mutbl: bool,
                 ident: ast::ident, ex: @ast::expr) -> @ast::stmt {
 
     let pat = @ast::pat {
@@ -219,7 +220,7 @@ pub fn mk_local(cx: ext_ctxt, sp: span, mutbl: bool,
     let decl = codemap::spanned {node: ast::decl_local(~[local]), span: sp};
     @codemap::spanned { node: ast::stmt_decl(@decl, cx.next_id()), span: sp }
 }
-pub fn mk_block(cx: ext_ctxt, span: span,
+pub fn mk_block(cx: @ext_ctxt, span: span,
                 +view_items: ~[@ast::view_item],
                 +stmts: ~[@ast::stmt],
                 expr: Option<@ast::expr>) -> @ast::expr {
@@ -235,7 +236,7 @@ pub fn mk_block(cx: ext_ctxt, span: span,
     };
     mk_expr(cx, span, ast::expr_block(blk))
 }
-pub fn mk_block_(cx: ext_ctxt,
+pub fn mk_block_(cx: @ext_ctxt,
                  span: span,
                  +stmts: ~[@ast::stmt])
               -> ast::blk {
@@ -250,7 +251,7 @@ pub fn mk_block_(cx: ext_ctxt,
         span: span,
     }
 }
-pub fn mk_simple_block(cx: ext_ctxt,
+pub fn mk_simple_block(cx: @ext_ctxt,
                        span: span,
                        expr: @ast::expr)
                     -> ast::blk {
@@ -265,21 +266,21 @@ pub fn mk_simple_block(cx: ext_ctxt,
         span: span,
     }
 }
-pub fn mk_copy(cx: ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
+pub fn mk_copy(cx: @ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
     mk_expr(cx, sp, ast::expr_copy(e))
 }
-pub fn mk_managed(cx: ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
+pub fn mk_managed(cx: @ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
     mk_expr(cx, sp, ast::expr_unary(ast::box(ast::m_imm), e))
 }
-pub fn mk_pat(cx: ext_ctxt, span: span, +pat: ast::pat_) -> @ast::pat {
+pub fn mk_pat(cx: @ext_ctxt, span: span, +pat: ast::pat_) -> @ast::pat {
     @ast::pat { id: cx.next_id(), node: pat, span: span }
 }
-pub fn mk_pat_ident(cx: ext_ctxt,
+pub fn mk_pat_ident(cx: @ext_ctxt,
                     span: span,
                     ident: ast::ident) -> @ast::pat {
     mk_pat_ident_with_binding_mode(cx, span, ident, ast::bind_by_copy)
 }
-pub fn mk_pat_ident_with_binding_mode(cx: ext_ctxt,
+pub fn mk_pat_ident_with_binding_mode(cx: @ext_ctxt,
                                       span: span,
                                       ident: ast::ident,
                                       bm: ast::binding_mode) -> @ast::pat {
@@ -287,7 +288,7 @@ pub fn mk_pat_ident_with_binding_mode(cx: ext_ctxt,
     let pat = ast::pat_ident(bm, path, None);
     mk_pat(cx, span, pat)
 }
-pub fn mk_pat_enum(cx: ext_ctxt,
+pub fn mk_pat_enum(cx: @ext_ctxt,
                    span: span,
                    path: @ast::path,
                    +subpats: ~[@ast::pat])
@@ -295,7 +296,7 @@ pub fn mk_pat_enum(cx: ext_ctxt,
     let pat = ast::pat_enum(path, Some(subpats));
     mk_pat(cx, span, pat)
 }
-pub fn mk_pat_struct(cx: ext_ctxt,
+pub fn mk_pat_struct(cx: @ext_ctxt,
                      span: span,
                      path: @ast::path,
                      +field_pats: ~[ast::field_pat])
@@ -303,17 +304,17 @@ pub fn mk_pat_struct(cx: ext_ctxt,
     let pat = ast::pat_struct(path, field_pats, false);
     mk_pat(cx, span, pat)
 }
-pub fn mk_bool(cx: ext_ctxt, span: span, value: bool) -> @ast::expr {
+pub fn mk_bool(cx: @ext_ctxt, span: span, value: bool) -> @ast::expr {
     let lit_expr = ast::expr_lit(@codemap::spanned {
         node: ast::lit_bool(value),
         span: span });
     build::mk_expr(cx, span, lit_expr)
 }
-pub fn mk_stmt(cx: ext_ctxt, span: span, expr: @ast::expr) -> @ast::stmt {
+pub fn mk_stmt(cx: @ext_ctxt, span: span, expr: @ast::expr) -> @ast::stmt {
     let stmt_ = ast::stmt_semi(expr, cx.next_id());
     @codemap::spanned { node: stmt_, span: span }
 }
-pub fn mk_ty_path(cx: ext_ctxt,
+pub fn mk_ty_path(cx: @ext_ctxt,
                   span: span,
                   +idents: ~[ ast::ident ])
                -> @ast::Ty {
@@ -322,7 +323,7 @@ pub fn mk_ty_path(cx: ext_ctxt,
     let ty = @ast::Ty { id: cx.next_id(), node: ty, span: span };
     ty
 }
-pub fn mk_ty_path_global(cx: ext_ctxt,
+pub fn mk_ty_path_global(cx: @ext_ctxt,
                          span: span,
                          +idents: ~[ ast::ident ])
                       -> @ast::Ty {
@@ -331,13 +332,13 @@ pub fn mk_ty_path_global(cx: ext_ctxt,
     let ty = @ast::Ty { id: cx.next_id(), node: ty, span: span };
     ty
 }
-pub fn mk_simple_ty_path(cx: ext_ctxt,
+pub fn mk_simple_ty_path(cx: @ext_ctxt,
                          span: span,
                          ident: ast::ident)
                       -> @ast::Ty {
     mk_ty_path(cx, span, ~[ ident ])
 }
-pub fn mk_arg(cx: ext_ctxt,
+pub fn mk_arg(cx: @ext_ctxt,
               span: span,
               ident: ast::ident,
               ty: @ast::Ty)
@@ -354,13 +355,13 @@ pub fn mk_arg(cx: ext_ctxt,
 pub fn mk_fn_decl(+inputs: ~[ast::arg], output: @ast::Ty) -> ast::fn_decl {
     ast::fn_decl { inputs: inputs, output: output, cf: ast::return_val }
 }
-pub fn mk_ty_param(cx: ext_ctxt,
+pub fn mk_ty_param(cx: @ext_ctxt,
                    ident: ast::ident,
                    bounds: @OptVec<ast::TyParamBound>)
                 -> ast::TyParam {
     ast::TyParam { ident: ident, id: cx.next_id(), bounds: bounds }
 }
-pub fn mk_lifetime(cx: ext_ctxt,
+pub fn mk_lifetime(cx: @ext_ctxt,
                    span: span,
                    ident: ast::ident) -> ast::Lifetime
 {
index 4f53bf62efbab671b19f158c3a789f7a4b71ce3f..0c3bef56459b52ed2fe36834560981744dbf8a93 100644 (file)
@@ -16,7 +16,7 @@
 use ext::base;
 use parse::token;
 
-pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_syntax_ext(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let mut res_str = ~"";
     for tts.eachi |i, e| {
index 093327ec32e0980a422002c85745f10f09315a29..26b5b4566b7f7494f62e0349c2639f35b87cd30d 100644 (file)
@@ -45,18 +45,18 @@ fn to_binop(self) -> binop {
     }
 }
 
-type ExpandDerivingStructDefFn = &self/fn(ext_ctxt,
+type ExpandDerivingStructDefFn = &self/fn(@ext_ctxt,
                                           span,
                                           x: &struct_def,
                                           ident,
                                           y: &Generics) -> @item;
-type ExpandDerivingEnumDefFn = &self/fn(ext_ctxt,
+type ExpandDerivingEnumDefFn = &self/fn(@ext_ctxt,
                                         span,
                                         x: &enum_def,
                                         ident,
                                         y: &Generics) -> @item;
 
-pub fn expand_meta_deriving(cx: ext_ctxt,
+pub fn expand_meta_deriving(cx: @ext_ctxt,
                             _span: span,
                             mitem: @meta_item,
                             in_items: ~[@item])
@@ -98,7 +98,7 @@ pub fn expand_meta_deriving(cx: ext_ctxt,
     }
 }
 
-pub fn expand_deriving_eq(cx: ext_ctxt,
+pub fn expand_deriving_eq(cx: @ext_ctxt,
                           span: span,
                           _mitem: @meta_item,
                           in_items: ~[@item])
@@ -110,7 +110,7 @@ pub fn expand_deriving_eq(cx: ext_ctxt,
                     expand_deriving_eq_enum_def)
 }
 
-pub fn expand_deriving_iter_bytes(cx: ext_ctxt,
+pub fn expand_deriving_iter_bytes(cx: @ext_ctxt,
                                   span: span,
                                   _mitem: @meta_item,
                                   in_items: ~[@item])
@@ -122,7 +122,7 @@ pub fn expand_deriving_iter_bytes(cx: ext_ctxt,
                     expand_deriving_iter_bytes_enum_def)
 }
 
-pub fn expand_deriving_clone(cx: ext_ctxt,
+pub fn expand_deriving_clone(cx: @ext_ctxt,
                              span: span,
                              _: @meta_item,
                              in_items: ~[@item])
@@ -134,7 +134,7 @@ pub fn expand_deriving_clone(cx: ext_ctxt,
                     expand_deriving_clone_enum_def)
 }
 
-fn expand_deriving(cx: ext_ctxt,
+fn expand_deriving(cx: @ext_ctxt,
                    span: span,
                    in_items: ~[@item],
                    expand_deriving_struct_def: ExpandDerivingStructDefFn,
@@ -164,7 +164,7 @@ fn expand_deriving(cx: ext_ctxt,
     result
 }
 
-fn create_impl_item(cx: ext_ctxt, span: span, +item: item_) -> @item {
+fn create_impl_item(cx: @ext_ctxt, span: span, +item: item_) -> @item {
     @ast::item {
         ident: clownshoes_extensions,
         attrs: ~[],
@@ -177,7 +177,7 @@ fn create_impl_item(cx: ext_ctxt, span: span, +item: item_) -> @item {
 
 /// Creates a method from the given expression, the signature of which
 /// conforms to the `eq` or `ne` method.
-fn create_eq_method(cx: ext_ctxt,
+fn create_eq_method(cx: @ext_ctxt,
                     span: span,
                     method_ident: ident,
                     type_ident: ident,
@@ -236,7 +236,7 @@ fn create_eq_method(cx: ext_ctxt,
     }
 }
 
-fn create_self_type_with_params(cx: ext_ctxt,
+fn create_self_type_with_params(cx: @ext_ctxt,
                                 span: span,
                                 type_ident: ident,
                                 generics: &Generics)
@@ -258,7 +258,7 @@ fn create_self_type_with_params(cx: ext_ctxt,
     @ast::Ty { id: cx.next_id(), node: self_type, span: span }
 }
 
-fn create_derived_impl(cx: ext_ctxt,
+fn create_derived_impl(cx: @ext_ctxt,
                        span: span,
                        type_ident: ident,
                        generics: &Generics,
@@ -320,7 +320,7 @@ fn create_derived_impl(cx: ext_ctxt,
     return create_impl_item(cx, span, impl_item);
 }
 
-fn create_derived_eq_impl(cx: ext_ctxt,
+fn create_derived_eq_impl(cx: @ext_ctxt,
                           span: span,
                           type_ident: ident,
                           generics: &Generics,
@@ -336,7 +336,7 @@ fn create_derived_eq_impl(cx: ext_ctxt,
     create_derived_impl(cx, span, type_ident, generics, methods, trait_path)
 }
 
-fn create_derived_iter_bytes_impl(cx: ext_ctxt,
+fn create_derived_iter_bytes_impl(cx: @ext_ctxt,
                                   span: span,
                                   type_ident: ident,
                                   generics: &Generics,
@@ -351,7 +351,7 @@ fn create_derived_iter_bytes_impl(cx: ext_ctxt,
     create_derived_impl(cx, span, type_ident, generics, methods, trait_path)
 }
 
-fn create_derived_clone_impl(cx: ext_ctxt,
+fn create_derived_clone_impl(cx: @ext_ctxt,
                              span: span,
                              type_ident: ident,
                              generics: &Generics,
@@ -368,7 +368,7 @@ fn create_derived_clone_impl(cx: ext_ctxt,
 
 // Creates a method from the given set of statements conforming to the
 // signature of the `iter_bytes` method.
-fn create_iter_bytes_method(cx: ext_ctxt,
+fn create_iter_bytes_method(cx: @ext_ctxt,
                             span: span,
                             +statements: ~[@stmt])
                          -> @method {
@@ -417,7 +417,7 @@ fn create_iter_bytes_method(cx: ext_ctxt,
 
 // Creates a method from the given expression conforming to the signature of
 // the `clone` method.
-fn create_clone_method(cx: ext_ctxt,
+fn create_clone_method(cx: @ext_ctxt,
                        span: span,
                        +type_ident: ast::ident,
                        generics: &Generics,
@@ -467,7 +467,7 @@ fn create_clone_method(cx: ext_ctxt,
     }
 }
 
-fn create_subpatterns(cx: ext_ctxt,
+fn create_subpatterns(cx: @ext_ctxt,
                       span: span,
                       prefix: ~str,
                       n: uint)
@@ -496,7 +496,7 @@ fn is_struct_tuple(struct_def: &struct_def) -> bool {
     })
 }
 
-fn create_enum_variant_pattern(cx: ext_ctxt,
+fn create_enum_variant_pattern(cx: @ext_ctxt,
                                span: span,
                                variant: &variant,
                                prefix: ~str)
@@ -542,7 +542,7 @@ fn create_enum_variant_pattern(cx: ext_ctxt,
     }
 }
 
-fn call_substructure_eq_method(cx: ext_ctxt,
+fn call_substructure_eq_method(cx: @ext_ctxt,
                                span: span,
                                self_field: @expr,
                                other_field_ref: @expr,
@@ -571,7 +571,7 @@ fn call_substructure_eq_method(cx: ext_ctxt,
     };
 }
 
-fn finish_eq_chain_expr(cx: ext_ctxt,
+fn finish_eq_chain_expr(cx: @ext_ctxt,
                         span: span,
                         chain_expr: Option<@expr>,
                         junction: Junction)
@@ -587,7 +587,7 @@ fn finish_eq_chain_expr(cx: ext_ctxt,
     }
 }
 
-fn call_substructure_iter_bytes_method(cx: ext_ctxt,
+fn call_substructure_iter_bytes_method(cx: @ext_ctxt,
                                        span: span,
                                        self_field: @expr)
                                     -> @stmt {
@@ -612,7 +612,7 @@ fn call_substructure_iter_bytes_method(cx: ext_ctxt,
     build::mk_stmt(cx, span, self_call)
 }
 
-fn call_substructure_clone_method(cx: ext_ctxt,
+fn call_substructure_clone_method(cx: @ext_ctxt,
                                   span: span,
                                   self_field: @expr)
                                -> @expr {
@@ -622,7 +622,7 @@ fn call_substructure_clone_method(cx: ext_ctxt,
     build::mk_call_(cx, span, self_method, ~[])
 }
 
-fn variant_arg_count(cx: ext_ctxt, span: span, variant: &variant) -> uint {
+fn variant_arg_count(cx: @ext_ctxt, span: span, variant: &variant) -> uint {
     match variant.node.kind {
         tuple_variant_kind(ref args) => args.len(),
         struct_variant_kind(ref struct_def) => struct_def.fields.len(),
@@ -632,7 +632,7 @@ fn variant_arg_count(cx: ext_ctxt, span: span, variant: &variant) -> uint {
     }
 }
 
-fn expand_deriving_eq_struct_def(cx: ext_ctxt,
+fn expand_deriving_eq_struct_def(cx: @ext_ctxt,
                                  span: span,
                                  struct_def: &struct_def,
                                  type_ident: ident,
@@ -672,7 +672,7 @@ fn expand_deriving_eq_struct_def(cx: ext_ctxt,
                                   ne_method);
 }
 
-fn expand_deriving_eq_enum_def(cx: ext_ctxt,
+fn expand_deriving_eq_enum_def(cx: @ext_ctxt,
                                span: span,
                                enum_definition: &enum_def,
                                type_ident: ident,
@@ -705,7 +705,7 @@ fn expand_deriving_eq_enum_def(cx: ext_ctxt,
                                   ne_method);
 }
 
-fn expand_deriving_iter_bytes_struct_def(cx: ext_ctxt,
+fn expand_deriving_iter_bytes_struct_def(cx: @ext_ctxt,
                                          span: span,
                                          struct_def: &struct_def,
                                          type_ident: ident,
@@ -724,7 +724,7 @@ fn expand_deriving_iter_bytes_struct_def(cx: ext_ctxt,
                                           method);
 }
 
-fn expand_deriving_iter_bytes_enum_def(cx: ext_ctxt,
+fn expand_deriving_iter_bytes_enum_def(cx: @ext_ctxt,
                                        span: span,
                                        enum_definition: &enum_def,
                                        type_ident: ident,
@@ -743,7 +743,7 @@ fn expand_deriving_iter_bytes_enum_def(cx: ext_ctxt,
                                           method);
 }
 
-fn expand_deriving_clone_struct_def(cx: ext_ctxt,
+fn expand_deriving_clone_struct_def(cx: @ext_ctxt,
                                     span: span,
                                     struct_def: &struct_def,
                                     type_ident: ident,
@@ -768,7 +768,7 @@ fn expand_deriving_clone_struct_def(cx: ext_ctxt,
     create_derived_clone_impl(cx, span, type_ident, generics, method)
 }
 
-fn expand_deriving_clone_enum_def(cx: ext_ctxt,
+fn expand_deriving_clone_enum_def(cx: @ext_ctxt,
                                   span: span,
                                   enum_definition: &enum_def,
                                   type_ident: ident,
@@ -785,7 +785,7 @@ fn expand_deriving_clone_enum_def(cx: ext_ctxt,
     create_derived_clone_impl(cx, span, type_ident, generics, method)
 }
 
-fn expand_deriving_eq_struct_method(cx: ext_ctxt,
+fn expand_deriving_eq_struct_method(cx: @ext_ctxt,
                                     span: span,
                                     struct_def: &struct_def,
                                     method_ident: ident,
@@ -841,7 +841,7 @@ fn expand_deriving_eq_struct_method(cx: ext_ctxt,
                             body);
 }
 
-fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
+fn expand_deriving_iter_bytes_struct_method(cx: @ext_ctxt,
                                             span: span,
                                             struct_def: &struct_def)
                                          -> @method {
@@ -875,7 +875,7 @@ fn expand_deriving_iter_bytes_struct_method(cx: ext_ctxt,
     return create_iter_bytes_method(cx, span, statements);
 }
 
-fn expand_deriving_clone_struct_method(cx: ext_ctxt,
+fn expand_deriving_clone_struct_method(cx: @ext_ctxt,
                                        span: span,
                                        struct_def: &struct_def,
                                        type_ident: ident,
@@ -918,7 +918,7 @@ fn expand_deriving_clone_struct_method(cx: ext_ctxt,
     create_clone_method(cx, span, type_ident, generics, struct_literal)
 }
 
-fn expand_deriving_clone_tuple_struct_method(cx: ext_ctxt,
+fn expand_deriving_clone_tuple_struct_method(cx: @ext_ctxt,
                                              span: span,
                                              struct_def: &struct_def,
                                              type_ident: ident,
@@ -962,7 +962,7 @@ fn expand_deriving_clone_tuple_struct_method(cx: ext_ctxt,
     create_clone_method(cx, span, type_ident, generics, self_match_expr)
 }
 
-fn expand_deriving_eq_enum_method(cx: ext_ctxt,
+fn expand_deriving_eq_enum_method(cx: @ext_ctxt,
                                   span: span,
                                   enum_definition: &enum_def,
                                   method_ident: ident,
@@ -1096,7 +1096,7 @@ fn expand_deriving_eq_enum_method(cx: ext_ctxt,
                             self_match_expr);
 }
 
-fn expand_deriving_eq_struct_tuple_method(cx: ext_ctxt,
+fn expand_deriving_eq_struct_tuple_method(cx: @ext_ctxt,
                                           span: span,
                                           struct_def: &struct_def,
                                           method_ident: ident,
@@ -1155,7 +1155,7 @@ fn expand_deriving_eq_struct_tuple_method(cx: ext_ctxt,
         type_ident, generics, self_match_expr)
 }
 
-fn expand_enum_or_struct_match(cx: ext_ctxt,
+fn expand_enum_or_struct_match(cx: @ext_ctxt,
                                span: span,
                                arms: ~[ ast::arm ])
                             -> @expr {
@@ -1166,7 +1166,7 @@ fn expand_enum_or_struct_match(cx: ext_ctxt,
     build::mk_expr(cx, span, self_match_expr)
 }
 
-fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
+fn expand_deriving_iter_bytes_enum_method(cx: @ext_ctxt,
                                           span: span,
                                           enum_definition: &enum_def)
                                        -> @method {
@@ -1221,7 +1221,7 @@ fn expand_deriving_iter_bytes_enum_method(cx: ext_ctxt,
     create_iter_bytes_method(cx, span, ~[ self_match_stmt ])
 }
 
-fn expand_deriving_clone_enum_method(cx: ext_ctxt,
+fn expand_deriving_clone_enum_method(cx: @ext_ctxt,
                                      span: span,
                                      enum_definition: &enum_def,
                                      type_ident: ident,
index c8fb83224ac74b2201e5dcdae84de31eb512ca5e..c21a9fa8739ff11197f456024f1eb489527509d4 100644 (file)
@@ -23,7 +23,7 @@
 use ext::base;
 use ext::build::mk_uniq_str;
 
-pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_syntax_ext(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
 
     let var = get_single_str_from_tts(cx, sp, tts, "env!");
index 831d1140a531b4e46136e615df9e2905b2d5807d..ec693fa1f087b536ccc7d7e03dabffe9e552b42b 100644 (file)
 use core::vec;
 
 pub fn expand_expr(extsbox: @mut SyntaxEnv,
-                   cx: ext_ctxt,
+                   cx: @ext_ctxt,
                    e: &expr_,
                    s: span,
-                   fld: ast_fold,
-                   orig: @fn(&expr_, span, ast_fold) -> (expr_, span))
+                   fld: @ast_fold,
+                   orig: @fn(&expr_, span, @ast_fold) -> (expr_, span))
                 -> (expr_, span) {
     match *e {
         // expr_mac should really be expr_ext or something; it's the
@@ -112,10 +112,10 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv,
 // NB: there is some redundancy between this and expand_item, below, and
 // they might benefit from some amount of semantic and language-UI merger.
 pub fn expand_mod_items(extsbox: @mut SyntaxEnv,
-                        cx: ext_ctxt,
+                        cx: @ext_ctxt,
                         module_: &ast::_mod,
-                        fld: ast_fold,
-                        orig: @fn(&ast::_mod, ast_fold) -> ast::_mod)
+                        fld: @ast_fold,
+                        orig: @fn(&ast::_mod, @ast_fold) -> ast::_mod)
                      -> ast::_mod {
     // Fold the contents first:
     let module_ = orig(module_, fld);
@@ -163,10 +163,10 @@ macro_rules! with_exts_frame (
 
 // When we enter a module, record it, for the sake of `module!`
 pub fn expand_item(extsbox: @mut SyntaxEnv,
-                   cx: ext_ctxt,
+                   cx: @ext_ctxt,
                    it: @ast::item,
-                   fld: ast_fold,
-                   orig: @fn(@ast::item, ast_fold) -> Option<@ast::item>)
+                   fld: @ast_fold,
+                   orig: @fn(@ast::item, @ast_fold) -> Option<@ast::item>)
                 -> Option<@ast::item> {
     // need to do expansion first... it might turn out to be a module.
     let maybe_it = match it.node {
@@ -239,9 +239,9 @@ macro_rules! without_macro_scoping(
 // Support for item-position macro invocations, exactly the same
 // logic as for expression-position macro invocations.
 pub fn expand_item_mac(+extsbox: @mut SyntaxEnv,
-                       cx: ext_ctxt, &&it: @ast::item,
-                       fld: ast_fold) -> Option<@ast::item> {
-
+                       cx: @ext_ctxt, &&it: @ast::item,
+                       fld: @ast_fold)
+                    -> Option<@ast::item> {
     let (pth, tts) = match it.node {
         item_mac(codemap::spanned { node: mac_invoc_tt(pth, ref tts), _}) => {
             (pth, copy *tts)
@@ -307,11 +307,11 @@ pub fn expand_item_mac(+extsbox: @mut SyntaxEnv,
 
 // expand a stmt
 pub fn expand_stmt(extsbox: @mut SyntaxEnv,
-                   cx: ext_ctxt,
+                   cx: @ext_ctxt,
                    s: &stmt_,
                    sp: span,
-                   fld: ast_fold,
-                   orig: @fn(&stmt_, span, ast_fold) -> (stmt_, span))
+                   fld: @ast_fold,
+                   orig: @fn(&stmt_, span, @ast_fold) -> (stmt_, span))
                 -> (stmt_, span) {
     let (mac, pth, tts, semi) = match *s {
         stmt_mac(ref mac, semi) => {
@@ -373,11 +373,11 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv,
 
 
 pub fn expand_block(extsbox: @mut SyntaxEnv,
-                    cx: ext_ctxt,
+                    cx: @ext_ctxt,
                     blk: &blk_,
                     sp: span,
-                    fld: ast_fold,
-                    orig: @fn(&blk_, span, ast_fold) -> (blk_, span))
+                    fld: @ast_fold,
+                    orig: @fn(&blk_, span, @ast_fold) -> (blk_, span))
                  -> (blk_, span) {
     match (*extsbox).find(&@~" block") {
         // no scope limit on macros in this block, no need
@@ -395,7 +395,7 @@ pub fn expand_block(extsbox: @mut SyntaxEnv,
     }
 }
 
-pub fn new_span(cx: ext_ctxt, sp: span) -> span {
+pub fn new_span(cx: @ext_ctxt, sp: span) -> span {
     /* this discards information in the case of macro-defining macros */
     return span {lo: sp.lo, hi: sp.hi, expn_info: cx.backtrace()};
 }
@@ -488,7 +488,7 @@ pub fn expand_crate(parse_sess: @mut parse::ParseSess,
     // every method/element of AstFoldFns in fold.rs.
     let extsbox = @mut syntax_expander_table();
     let afp = default_ast_fold();
-    let cx: ext_ctxt = mk_ctxt(parse_sess, copy cfg);
+    let cx: @ext_ctxt = mk_ctxt(parse_sess, copy cfg);
     let f_pre = @AstFoldFns {
         fold_expr: |expr,span,recur|
             expand_expr(extsbox, cx, expr, span, recur, afp.fold_expr),
index ee0de9e48dbc1bf2cb5228473686ef4d6b07e77f..f6a6ddefb7efc4663e313eee694f0eeccab6e886 100644 (file)
@@ -27,7 +27,7 @@
 
 use core::unstable::extfmt::ct::*;
 
-pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_syntax_ext(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let args = get_exprs_from_tts(cx, tts);
     if args.len() == 0 {
@@ -38,7 +38,7 @@ pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
                     ~"first argument to fmt! must be a string literal.");
     let fmtspan = args[0].span;
     debug!("Format string: %s", fmt);
-    fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: &str) -> ! {
+    fn parse_fmt_err_(cx: @ext_ctxt, sp: span, msg: &str) -> ! {
         cx.span_fatal(sp, msg);
     }
     let parse_fmt_err: @fn(&str) -> ! = |s| parse_fmt_err_(cx, fmtspan, s);
@@ -50,23 +50,23 @@ fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: &str) -> ! {
 // probably be factored out in common with other code that builds
 // expressions.  Also: Cleanup the naming of these functions.
 // Note: Moved many of the common ones to build.rs --kevina
-fn pieces_to_expr(cx: ext_ctxt, sp: span,
+fn pieces_to_expr(cx: @ext_ctxt, sp: span,
                   pieces: ~[Piece], args: ~[@ast::expr])
    -> @ast::expr {
-    fn make_path_vec(cx: ext_ctxt, ident: @~str) -> ~[ast::ident] {
+    fn make_path_vec(cx: @ext_ctxt, ident: @~str) -> ~[ast::ident] {
         let intr = cx.parse_sess().interner;
         return ~[intr.intern(@~"unstable"), intr.intern(@~"extfmt"),
                  intr.intern(@~"rt"), intr.intern(ident)];
     }
-    fn make_rt_path_expr(cx: ext_ctxt, sp: span, nm: @~str) -> @ast::expr {
+    fn make_rt_path_expr(cx: @ext_ctxt, sp: span, nm: @~str) -> @ast::expr {
         let path = make_path_vec(cx, nm);
         return mk_path_global(cx, sp, path);
     }
     // Produces an AST expression that represents a RT::conv record,
     // which tells the RT::conv* functions how to perform the conversion
 
-    fn make_rt_conv_expr(cx: ext_ctxt, sp: span, cnv: Conv) -> @ast::expr {
-        fn make_flags(cx: ext_ctxt, sp: span, flags: ~[Flag]) -> @ast::expr {
+    fn make_rt_conv_expr(cx: @ext_ctxt, sp: span, cnv: Conv) -> @ast::expr {
+        fn make_flags(cx: @ext_ctxt, sp: span, flags: ~[Flag]) -> @ast::expr {
             let mut tmp_expr = make_rt_path_expr(cx, sp, @~"flag_none");
             for flags.each |f| {
                 let fstr = match *f {
@@ -81,7 +81,7 @@ fn make_flags(cx: ext_ctxt, sp: span, flags: ~[Flag]) -> @ast::expr {
             }
             return tmp_expr;
         }
-        fn make_count(cx: ext_ctxt, sp: span, cnt: Count) -> @ast::expr {
+        fn make_count(cx: @ext_ctxt, sp: span, cnt: Count) -> @ast::expr {
             match cnt {
               CountImplied => {
                 return make_rt_path_expr(cx, sp, @~"CountImplied");
@@ -95,7 +95,7 @@ fn make_count(cx: ext_ctxt, sp: span, cnt: Count) -> @ast::expr {
               _ => cx.span_unimpl(sp, ~"unimplemented fmt! conversion")
             }
         }
-        fn make_ty(cx: ext_ctxt, sp: span, t: Ty) -> @ast::expr {
+        fn make_ty(cx: @ext_ctxt, sp: span, t: Ty) -> @ast::expr {
             let mut rt_type;
             match t {
               TyHex(c) => match c {
@@ -108,7 +108,7 @@ fn make_ty(cx: ext_ctxt, sp: span, t: Ty) -> @ast::expr {
             }
             return make_rt_path_expr(cx, sp, @rt_type);
         }
-        fn make_conv_struct(cx: ext_ctxt, sp: span, flags_expr: @ast::expr,
+        fn make_conv_struct(cx: @ext_ctxt, sp: span, flags_expr: @ast::expr,
                          width_expr: @ast::expr, precision_expr: @ast::expr,
                          ty_expr: @ast::expr) -> @ast::expr {
             let intr = cx.parse_sess().interner;
@@ -139,7 +139,7 @@ fn make_conv_struct(cx: ext_ctxt, sp: span, flags_expr: @ast::expr,
         make_conv_struct(cx, sp, rt_conv_flags, rt_conv_width,
                          rt_conv_precision, rt_conv_ty)
     }
-    fn make_conv_call(cx: ext_ctxt, sp: span, conv_type: ~str, cnv: Conv,
+    fn make_conv_call(cx: @ext_ctxt, sp: span, conv_type: ~str, cnv: Conv,
                       arg: @ast::expr) -> @ast::expr {
         let fname = ~"conv_" + conv_type;
         let path = make_path_vec(cx, @fname);
@@ -148,7 +148,7 @@ fn make_conv_call(cx: ext_ctxt, sp: span, conv_type: ~str, cnv: Conv,
         return mk_call_global(cx, arg.span, path, args);
     }
 
-    fn make_new_conv(cx: ext_ctxt, sp: span, cnv: Conv, arg: @ast::expr) ->
+    fn make_new_conv(cx: @ext_ctxt, sp: span, cnv: Conv, arg: @ast::expr) ->
        @ast::expr {
         // FIXME: Move validation code into core::extfmt (Issue #2249)
 
index 8a8583420f8fc9c55d7f112357cb0d988b4dda6c..bf4a997bc171f201110b914d2c4cb609925da64e 100644 (file)
@@ -17,7 +17,7 @@
 use ext::base;
 use print;
 
-pub fn expand_syntax_ext(cx: ext_ctxt,
+pub fn expand_syntax_ext(cx: @ext_ctxt,
                          sp: codemap::span,
                          tt: &[ast::token_tree])
                       -> base::MacResult {
index e6f0cdde8c1508aa92b91215dbddbaf39a03f0c6..76b70225c6c84d0cad46ffa726db3713a2ceeaac 100644 (file)
@@ -138,7 +138,7 @@ fn item_ty_poly(&self,
     fn strip_bounds(&self, bounds: &Generics) -> Generics;
 }
 
-impl ext_ctxt_ast_builder for ext_ctxt {
+impl ext_ctxt_ast_builder for @ext_ctxt {
     fn ty_option(&self, ty: @ast::Ty) -> @ast::Ty {
         self.ty_path_ast_builder(path_global(~[
             self.ident_of(~"core"),
index b543ef5fdaef00202e3e0eadaf8fa7c89e4000a6..30e7e832db197fd129e23dd6363aa844ccd25761 100644 (file)
@@ -37,9 +37,8 @@
 use ext::pipes::proto::{state, protocol, next_state};
 use ext::pipes::proto;
 
-impl proto::visitor<(), (), ()> for ext_ctxt {
-    fn visit_proto(&self, _proto: protocol,
-                   _states: &[()]) { }
+impl proto::visitor<(), (), ()> for @ext_ctxt {
+    fn visit_proto(&self, _proto: protocol, _states: &[()]) { }
 
     fn visit_state(&self, state: state, _m: &[()]) {
         if state.messages.len() == 0 {
index c5bed32a24f2a13ca8d50dca9c37757561be9e32..97f2e516603beb7e040c246653f131f6ee455b73 100644 (file)
@@ -45,7 +45,7 @@
 use core::str;
 use std::bitv::Bitv;
 
-pub fn analyze(proto: protocol, _cx: ext_ctxt) {
+pub fn analyze(proto: protocol, _cx: @ext_ctxt) {
     debug!("initializing colive analysis");
     let num_states = proto.num_states();
     let mut colive = do (copy proto.states).map_to_vec |state| {
index df17c960ba21dc6ee0e9787ce5d82e5ec10e4d5d..327cb0ae517e23fe8a8666452aef3392d048b7d7 100644 (file)
 pub mod liveness;
 
 
-pub fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident,
+pub fn expand_proto(cx: @ext_ctxt, _sp: span, id: ast::ident,
                     tt: ~[ast::token_tree]) -> base::MacResult {
     let sess = cx.parse_sess();
     let cfg = cx.cfg();
     let tt_rdr = new_tt_reader(copy cx.parse_sess().span_diagnostic,
-                               cx.parse_sess().interner, None, copy tt);
-    let rdr = tt_rdr as reader;
+                               cx.parse_sess().interner,
+                               None,
+                               copy tt);
+    let rdr = tt_rdr as @reader;
     let rust_parser = Parser(sess, cfg, rdr.dup());
 
     let mut proto = rust_parser.parse_proto(cx.str_of(id));
index fd8b2dbf72f815365b49416555b81a9d333a45b0..a7725eab695ed1d8c6c8d7c80806e2295d36d260 100644 (file)
 use core::vec;
 
 pub trait gen_send {
-    fn gen_send(&mut self, cx: ext_ctxt, try: bool) -> @ast::item;
-    fn to_ty(&mut self, cx: ext_ctxt) -> @ast::Ty;
+    fn gen_send(&mut self, cx: @ext_ctxt, try: bool) -> @ast::item;
+    fn to_ty(&mut self, cx: @ext_ctxt) -> @ast::Ty;
 }
 
 pub trait to_type_decls {
-    fn to_type_decls(&self, cx: ext_ctxt) -> ~[@ast::item];
-    fn to_endpoint_decls(&self, cx: ext_ctxt,
+    fn to_type_decls(&self, cx: @ext_ctxt) -> ~[@ast::item];
+    fn to_endpoint_decls(&self, cx: @ext_ctxt,
                          dir: direction) -> ~[@ast::item];
 }
 
 pub trait gen_init {
-    fn gen_init(&self, cx: ext_ctxt) -> @ast::item;
-    fn compile(&self, cx: ext_ctxt) -> @ast::item;
-    fn buffer_ty_path(&self, cx: ext_ctxt) -> @ast::Ty;
-    fn gen_buffer_type(&self, cx: ext_ctxt) -> @ast::item;
-    fn gen_buffer_init(&self, ext_cx: ext_ctxt) -> @ast::expr;
-    fn gen_init_bounded(&self, ext_cx: ext_ctxt) -> @ast::expr;
+    fn gen_init(&self, cx: @ext_ctxt) -> @ast::item;
+    fn compile(&self, cx: @ext_ctxt) -> @ast::item;
+    fn buffer_ty_path(&self, cx: @ext_ctxt) -> @ast::Ty;
+    fn gen_buffer_type(&self, cx: @ext_ctxt) -> @ast::item;
+    fn gen_buffer_init(&self, ext_cx: @ext_ctxt) -> @ast::expr;
+    fn gen_init_bounded(&self, ext_cx: @ext_ctxt) -> @ast::expr;
 }
 
 impl gen_send for message {
-    fn gen_send(&mut self, cx: ext_ctxt, try: bool) -> @ast::item {
+    fn gen_send(&mut self, cx: @ext_ctxt, try: bool) -> @ast::item {
         debug!("pipec: gen_send");
         let name = self.name();
 
@@ -188,14 +188,14 @@ fn gen_send(&mut self, cx: ext_ctxt, try: bool) -> @ast::item {
           }
         }
 
-    fn to_ty(&mut self, cx: ext_ctxt) -> @ast::Ty {
+    fn to_ty(&mut self, cx: @ext_ctxt) -> @ast::Ty {
         cx.ty_path_ast_builder(path(~[cx.ident_of(self.name())], self.span())
           .add_tys(cx.ty_vars_global(&self.get_generics().ty_params)))
     }
 }
 
 impl to_type_decls for state {
-    fn to_type_decls(&self, cx: ext_ctxt) -> ~[@ast::item] {
+    fn to_type_decls(&self, cx: @ext_ctxt) -> ~[@ast::item] {
         debug!("pipec: to_type_decls");
         // This compiles into two different type declarations. Say the
         // state is called ping. This will generate both `ping` and
@@ -244,7 +244,7 @@ fn to_type_decls(&self, cx: ext_ctxt) -> ~[@ast::item] {
         ]
     }
 
-    fn to_endpoint_decls(&self, cx: ext_ctxt,
+    fn to_endpoint_decls(&self, cx: @ext_ctxt,
                          dir: direction) -> ~[@ast::item] {
         debug!("pipec: to_endpoint_decls");
         let dir = match dir {
@@ -306,7 +306,7 @@ fn to_endpoint_decls(&self, cx: ext_ctxt,
 }
 
 impl gen_init for protocol {
-    fn gen_init(&self, cx: ext_ctxt) -> @ast::item {
+    fn gen_init(&self, cx: @ext_ctxt) -> @ast::item {
         let ext_cx = cx;
 
         debug!("gen_init");
@@ -344,7 +344,7 @@ fn gen_init(&self, cx: ext_ctxt) -> @ast::item {
                            body.to_source(cx)))
     }
 
-    fn gen_buffer_init(&self, ext_cx: ext_ctxt) -> @ast::expr {
+    fn gen_buffer_init(&self, ext_cx: @ext_ctxt) -> @ast::expr {
         ext_cx.struct_expr(path(~[ext_cx.ident_of(~"__Buffer")],
                                 dummy_sp()),
                       self.states.map_to_vec(|s| {
@@ -356,7 +356,7 @@ fn gen_buffer_init(&self, ext_cx: ext_ctxt) -> @ast::expr {
         }))
     }
 
-    fn gen_init_bounded(&self, ext_cx: ext_ctxt) -> @ast::expr {
+    fn gen_init_bounded(&self, ext_cx: @ext_ctxt) -> @ast::expr {
         debug!("gen_init_bounded");
         let buffer_fields = self.gen_buffer_init(ext_cx);
         let buffer = quote_expr!(~::core::pipes::Buffer {
@@ -382,7 +382,7 @@ fn gen_init_bounded(&self, ext_cx: ext_ctxt) -> @ast::expr {
         })
     }
 
-    fn buffer_ty_path(&self, cx: ext_ctxt) -> @ast::Ty {
+    fn buffer_ty_path(&self, cx: @ext_ctxt) -> @ast::Ty {
         let mut params: OptVec<ast::TyParam> = opt_vec::Empty;
         for (copy self.states).each |s| {
             for s.generics.ty_params.each |tp| {
@@ -399,7 +399,7 @@ fn buffer_ty_path(&self, cx: ext_ctxt) -> @ast::Ty {
                                .add_tys(cx.ty_vars_global(&params)))
     }
 
-    fn gen_buffer_type(&self, cx: ext_ctxt) -> @ast::item {
+    fn gen_buffer_type(&self, cx: @ext_ctxt) -> @ast::item {
         let ext_cx = cx;
         let mut params: OptVec<ast::TyParam> = opt_vec::Empty;
         let fields = do (copy self.states).map_to_vec |s| {
@@ -442,7 +442,7 @@ fn gen_buffer_type(&self, cx: ext_ctxt) -> @ast::item {
             cx.strip_bounds(&generics))
     }
 
-    fn compile(&self, cx: ext_ctxt) -> @ast::item {
+    fn compile(&self, cx: @ext_ctxt) -> @ast::item {
         let mut items = ~[self.gen_init(cx)];
         let mut client_states = ~[];
         let mut server_states = ~[];
index dc9abd536d11fc0d6dce3c628d7c9f1625cf4862..60df7623e40f07327e6120355dd9acc555cc4c59 100644 (file)
@@ -96,7 +96,7 @@ fn data_name(&self) -> ast::ident {
     }
 
     /// Returns the type that is used for the messages.
-    fn to_ty(&self, cx: ext_ctxt) -> @ast::Ty {
+    fn to_ty(&self, cx: @ext_ctxt) -> @ast::Ty {
         cx.ty_path_ast_builder
             (path(~[cx.ident_of(self.name)],self.span).add_tys(
                 cx.ty_vars(&self.generics.ty_params)))
index 49d5ed1d0cc88860fe83eec5197d5f6af05519a4..6deffbe0ae14670ef3c0dff9f58b0d4d3862e374 100644 (file)
@@ -49,11 +49,11 @@ pub mod rt {
     use print::pprust::{item_to_str, ty_to_str};
 
     pub trait ToTokens {
-        pub fn to_tokens(&self, _cx: ext_ctxt) -> ~[token_tree];
+        pub fn to_tokens(&self, _cx: @ext_ctxt) -> ~[token_tree];
     }
 
     impl ToTokens for ~[token_tree] {
-        pub fn to_tokens(&self, _cx: ext_ctxt) -> ~[token_tree] {
+        pub fn to_tokens(&self, _cx: @ext_ctxt) -> ~[token_tree] {
             copy *self
         }
     }
@@ -62,10 +62,10 @@ pub fn to_tokens(&self, _cx: ext_ctxt) -> ~[token_tree] {
 
     trait ToSource : ToTokens {
         // Takes a thing and generates a string containing rust code for it.
-        pub fn to_source(cx: ext_ctxt) -> ~str;
+        pub fn to_source(cx: @ext_ctxt) -> ~str;
 
         // If you can make source, you can definitely make tokens.
-        pub fn to_tokens(cx: ext_ctxt) -> ~[token_tree] {
+        pub fn to_tokens(cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
@@ -74,47 +74,47 @@ pub fn to_tokens(cx: ext_ctxt) -> ~[token_tree] {
 
     pub trait ToSource {
         // Takes a thing and generates a string containing rust code for it.
-        pub fn to_source(&self, cx: ext_ctxt) -> ~str;
+        pub fn to_source(&self, cx: @ext_ctxt) -> ~str;
     }
 
     impl ToSource for ast::ident {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             copy *cx.parse_sess().interner.get(*self)
         }
     }
 
     impl ToSource for @ast::item {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             item_to_str(*self, cx.parse_sess().interner)
         }
     }
 
     impl ToSource for ~[@ast::item] {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             str::connect(self.map(|i| i.to_source(cx)), ~"\n\n")
         }
     }
 
     impl ToSource for @ast::Ty {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             ty_to_str(*self, cx.parse_sess().interner)
         }
     }
 
     impl ToSource for ~[@ast::Ty] {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             str::connect(self.map(|i| i.to_source(cx)), ~", ")
         }
     }
 
     impl ToSource for Generics {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             pprust::generics_to_str(self, cx.parse_sess().interner)
         }
     }
 
     impl ToSource for @ast::expr {
-        fn to_source(&self, cx: ext_ctxt) -> ~str {
+        fn to_source(&self, cx: @ext_ctxt) -> ~str {
             pprust::expr_to_str(*self, cx.parse_sess().interner)
         }
     }
@@ -122,43 +122,43 @@ fn to_source(&self, cx: ext_ctxt) -> ~str {
     // Alas ... we write these out instead. All redundant.
 
     impl ToTokens for ast::ident {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for @ast::item {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for ~[@ast::item] {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for @ast::Ty {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for ~[@ast::Ty] {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for Generics {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
 
     impl ToTokens for @ast::expr {
-        fn to_tokens(&self, cx: ext_ctxt) -> ~[token_tree] {
+        fn to_tokens(&self, cx: @ext_ctxt) -> ~[token_tree] {
             cx.parse_tts(self.to_source(cx))
         }
     }
@@ -170,7 +170,7 @@ pub trait ExtParseUtils {
         fn parse_tts(&self, s: ~str) -> ~[ast::token_tree];
     }
 
-    impl ExtParseUtils for ext_ctxt {
+    impl ExtParseUtils for @ext_ctxt {
 
         fn parse_item(&self, s: ~str) -> @ast::item {
             let res = parse::parse_item_from_source_str(
@@ -216,19 +216,19 @@ fn parse_tts(&self, s: ~str) -> ~[ast::token_tree] {
 
 }
 
-pub fn expand_quote_tokens(cx: ext_ctxt,
+pub fn expand_quote_tokens(cx: @ext_ctxt,
                            sp: span,
                            tts: &[ast::token_tree]) -> base::MacResult {
     base::MRExpr(expand_tts(cx, sp, tts))
 }
 
-pub fn expand_quote_expr(cx: ext_ctxt,
+pub fn expand_quote_expr(cx: @ext_ctxt,
                          sp: span,
                          tts: &[ast::token_tree]) -> base::MacResult {
     base::MRExpr(expand_parse_call(cx, sp, ~"parse_expr", ~[], tts))
 }
 
-pub fn expand_quote_item(cx: ext_ctxt,
+pub fn expand_quote_item(cx: @ext_ctxt,
                          sp: span,
                          tts: &[ast::token_tree]) -> base::MacResult {
     let e_attrs = build::mk_uniq_vec_e(cx, sp, ~[]);
@@ -236,7 +236,7 @@ pub fn expand_quote_item(cx: ext_ctxt,
                                     ~[e_attrs], tts))
 }
 
-pub fn expand_quote_pat(cx: ext_ctxt,
+pub fn expand_quote_pat(cx: @ext_ctxt,
                         sp: span,
                         tts: &[ast::token_tree]) -> base::MacResult {
     let e_refutable = build::mk_lit(cx, sp, ast::lit_bool(true));
@@ -244,7 +244,7 @@ pub fn expand_quote_pat(cx: ext_ctxt,
                                     ~[e_refutable], tts))
 }
 
-pub fn expand_quote_ty(cx: ext_ctxt,
+pub fn expand_quote_ty(cx: @ext_ctxt,
                        sp: span,
                        tts: &[ast::token_tree]) -> base::MacResult {
     let e_param_colons = build::mk_lit(cx, sp, ast::lit_bool(false));
@@ -252,7 +252,7 @@ pub fn expand_quote_ty(cx: ext_ctxt,
                                     ~[e_param_colons], tts))
 }
 
-pub fn expand_quote_stmt(cx: ext_ctxt,
+pub fn expand_quote_stmt(cx: @ext_ctxt,
                          sp: span,
                          tts: &[ast::token_tree]) -> base::MacResult {
     let e_attrs = build::mk_uniq_vec_e(cx, sp, ~[]);
@@ -260,16 +260,16 @@ pub fn expand_quote_stmt(cx: ext_ctxt,
                                     ~[e_attrs], tts))
 }
 
-fn ids_ext(cx: ext_ctxt, strs: ~[~str]) -> ~[ast::ident] {
+fn ids_ext(cx: @ext_ctxt, strs: ~[~str]) -> ~[ast::ident] {
     strs.map(|str| cx.parse_sess().interner.intern(@copy *str))
 }
 
-fn id_ext(cx: ext_ctxt, +str: ~str) -> ast::ident {
+fn id_ext(cx: @ext_ctxt, +str: ~str) -> ast::ident {
     cx.parse_sess().interner.intern(@str)
 }
 
 // Lift an ident to the expr that evaluates to that ident.
-fn mk_ident(cx: ext_ctxt, sp: span, ident: ast::ident) -> @ast::expr {
+fn mk_ident(cx: @ext_ctxt, sp: span, ident: ast::ident) -> @ast::expr {
     let e_meth = build::mk_access(cx, sp,
                                   ids_ext(cx, ~[~"ext_cx"]),
                                   id_ext(cx, ~"ident_of"));
@@ -277,13 +277,13 @@ fn mk_ident(cx: ext_ctxt, sp: span, ident: ast::ident) -> @ast::expr {
     build::mk_call_(cx, sp, e_meth, ~[e_str])
 }
 
-fn mk_bytepos(cx: ext_ctxt, sp: span, bpos: BytePos) -> @ast::expr {
+fn mk_bytepos(cx: @ext_ctxt, sp: span, bpos: BytePos) -> @ast::expr {
     let path = ids_ext(cx, ~[~"BytePos"]);
     let arg = build::mk_uint(cx, sp, bpos.to_uint());
     build::mk_call(cx, sp, path, ~[arg])
 }
 
-fn mk_binop(cx: ext_ctxt, sp: span, bop: token::binop) -> @ast::expr {
+fn mk_binop(cx: @ext_ctxt, sp: span, bop: token::binop) -> @ast::expr {
     let name = match bop {
         PLUS => "PLUS",
         MINUS => "MINUS",
@@ -300,7 +300,7 @@ fn mk_binop(cx: ext_ctxt, sp: span, bop: token::binop) -> @ast::expr {
                    ids_ext(cx, ~[name.to_owned()]))
 }
 
-fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr {
+fn mk_token(cx: @ext_ctxt, sp: span, tok: token::Token) -> @ast::expr {
 
     match tok {
         BINOP(binop) => {
@@ -443,7 +443,7 @@ fn mk_token(cx: ext_ctxt, sp: span, tok: token::Token) -> @ast::expr {
 }
 
 
-fn mk_tt(cx: ext_ctxt, sp: span, tt: &ast::token_tree)
+fn mk_tt(cx: @ext_ctxt, sp: span, tt: &ast::token_tree)
     -> ~[@ast::stmt] {
 
     match *tt {
@@ -494,7 +494,7 @@ fn mk_tt(cx: ext_ctxt, sp: span, tt: &ast::token_tree)
     }
 }
 
-fn mk_tts(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+fn mk_tts(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> ~[@ast::stmt] {
     let mut ss = ~[];
     for tts.each |tt| {
@@ -503,7 +503,7 @@ fn mk_tts(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     ss
 }
 
-fn expand_tts(cx: ext_ctxt,
+fn expand_tts(cx: @ext_ctxt,
               sp: span,
               tts: &[ast::token_tree]) -> @ast::expr {
 
@@ -577,7 +577,7 @@ fn expand_tts(cx: ext_ctxt,
                                         ids_ext(cx, ~[~"tt"]))))
 }
 
-fn expand_parse_call(cx: ext_ctxt,
+fn expand_parse_call(cx: @ext_ctxt,
                      sp: span,
                      +parse_method: ~str,
                      +arg_exprs: ~[@ast::expr],
index 296305bb62e17c042d7bee19275f180fb3b1c9d6..b2de322be5531ec8e408de817f4a0d2d492d34f1 100644 (file)
@@ -29,7 +29,7 @@
 // a given file into the current one.
 
 /* line!(): expands to the current line number */
-pub fn expand_line(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_line(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "line!");
 
@@ -40,7 +40,7 @@ pub fn expand_line(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
 }
 
 /* col!(): expands to the current column number */
-pub fn expand_col(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_col(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "col!");
 
@@ -52,7 +52,7 @@ pub fn expand_col(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
 /* file!(): expands to the current filename */
 /* The filemap (`loc.file`) contains a bunch more information we could spit
  * out if we wanted. */
-pub fn expand_file(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_file(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "file!");
 
@@ -62,13 +62,13 @@ pub fn expand_file(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     base::MRExpr(mk_base_str(cx, topmost.call_site, filename))
 }
 
-pub fn expand_stringify(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_stringify(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let s = pprust::tts_to_str(tts, cx.parse_sess().interner);
     base::MRExpr(mk_base_str(cx, sp, s))
 }
 
-pub fn expand_mod(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_mod(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "module_path!");
     base::MRExpr(mk_base_str(cx, sp,
@@ -79,7 +79,7 @@ pub fn expand_mod(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
 // include! : parse the given file as an expr
 // This is generally a bad idea because it's going to behave
 // unhygienically.
-pub fn expand_include(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_include(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let file = get_single_str_from_tts(cx, sp, tts, "include!");
     let p = parse::new_sub_parser_from_file(
@@ -89,7 +89,7 @@ pub fn expand_include(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
 }
 
 // include_str! : read the given file, insert it as a literal string expr
-pub fn expand_include_str(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_include_str(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let file = get_single_str_from_tts(cx, sp, tts, "include_str!");
     let res = io::read_whole_file_str(&res_rel_file(cx, sp, &Path(file)));
@@ -103,7 +103,7 @@ pub fn expand_include_str(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
     base::MRExpr(mk_base_str(cx, sp, result::unwrap(res)))
 }
 
-pub fn expand_include_bin(cx: ext_ctxt, sp: span, tts: &[ast::token_tree])
+pub fn expand_include_bin(cx: @ext_ctxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     let file = get_single_str_from_tts(cx, sp, tts, "include_bin!");
     match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) {
@@ -147,7 +147,7 @@ fn topmost_expn_info(expn_info: @codemap::ExpnInfo) -> @codemap::ExpnInfo {
 
 // resolve a file-system path to an absolute file-system path (if it
 // isn't already)
-fn res_rel_file(cx: ext_ctxt, sp: codemap::span, arg: &Path) -> Path {
+fn res_rel_file(cx: @ext_ctxt, sp: codemap::span, arg: &Path) -> Path {
     // NB: relative paths are resolved relative to the compilation unit
     if !arg.is_absolute {
         let cu = Path(cx.codemap().span_to_filename(sp));
index b53523f78a4228981dd277b20568dbbafe962b0b..29a959013f258bb16d72ed1c6817832165f7ce6f 100644 (file)
 use parse::lexer::{new_tt_reader, reader};
 use parse::parser::Parser;
 
-pub fn expand_trace_macros(cx: ext_ctxt, sp: span,
-                           tt: &[ast::token_tree]) -> base::MacResult {
+pub fn expand_trace_macros(cx: @ext_ctxt,
+                           sp: span,
+                           tt: &[ast::token_tree])
+                        -> base::MacResult {
     let sess = cx.parse_sess();
     let cfg = cx.cfg();
     let tt_rdr = new_tt_reader(
@@ -27,7 +29,7 @@ pub fn expand_trace_macros(cx: ext_ctxt, sp: span,
         None,
         vec::from_slice(tt)
     );
-    let rdr = tt_rdr as reader;
+    let rdr = tt_rdr as @reader;
     let rust_parser = Parser(
         sess,
         copy cfg,
index 88797a152066a9045e322d4f341242294b49de9a..b0628437bb0ff462fd4c8df3fc05dfd95881cbcc 100644 (file)
@@ -224,7 +224,7 @@ pub enum parse_result {
 pub fn parse_or_else(
     sess: @mut ParseSess,
     +cfg: ast::crate_cfg,
-    rdr: reader,
+    rdr: @reader,
     ms: ~[matcher]
 ) -> HashMap<ident, @named_match> {
     match parse(sess, cfg, rdr, ms) {
@@ -237,7 +237,7 @@ pub fn parse_or_else(
 pub fn parse(
     sess: @mut ParseSess,
     cfg: ast::crate_cfg,
-    rdr: reader,
+    rdr: @reader,
     ms: ~[matcher]
 ) -> parse_result {
     let mut cur_eis = ~[];
index e5b7152bea24070d860a3f24ccea61124f098cee..dcc84ce46fe05197415b7b14530ca3844dedc869 100644 (file)
 
 use core::io;
 
-pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
-                         arg: ~[ast::token_tree]) -> base::MacResult {
+pub fn add_new_extension(cx: @ext_ctxt,
+                         sp: span,
+                         name: ident,
+                         arg: ~[ast::token_tree])
+                      -> base::MacResult {
     // these spans won't matter, anyways
     fn ms(m: matcher_) -> matcher {
         spanned { node: copy m, span: dummy_sp() }
@@ -54,8 +57,10 @@ fn ms(m: matcher_) -> matcher {
     // Parse the macro_rules! invocation (`none` is for no interpolations):
     let arg_reader = new_tt_reader(copy cx.parse_sess().span_diagnostic,
                                    cx.parse_sess().interner, None, copy arg);
-    let argument_map = parse_or_else(cx.parse_sess(), cx.cfg(),
-                                     arg_reader as reader, argument_gram);
+    let argument_map = parse_or_else(cx.parse_sess(),
+                                     cx.cfg(),
+                                     arg_reader as @reader,
+                                     argument_gram);
 
     // Extract the arguments:
     let lhses = match argument_map.get(&lhs_nm) {
@@ -69,7 +74,7 @@ fn ms(m: matcher_) -> matcher {
     };
 
     // Given `lhses` and `rhses`, this is the new macro we create
-    fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
+    fn generic_extension(cx: @ext_ctxt, sp: span, name: ident,
                          arg: &[ast::token_tree],
                          lhses: ~[@named_match], rhses: ~[@named_match])
     -> MacResult {
@@ -98,7 +103,7 @@ fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
                     itr,
                     None,
                     vec::from_slice(arg)
-                ) as reader;
+                ) as @reader;
                 match parse(cx.parse_sess(), cx.cfg(), arg_rdr, (*mtcs)) {
                   success(named_matches) => {
                     let rhs = match rhses[i] {
@@ -118,8 +123,9 @@ fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
                     // rhs has holes ( `$id` and `$(...)` that need filled)
                     let trncbr = new_tt_reader(s_d, itr, Some(named_matches),
                                                rhs);
-                    let p = @Parser(cx.parse_sess(), cx.cfg(),
-                                    trncbr as reader);
+                    let p = @Parser(cx.parse_sess(),
+                                    cx.cfg(),
+                                    trncbr as @reader);
 
                     // Let the context choose how to interpret the result.
                     // Weird, but useful for X-macros.
@@ -140,7 +146,7 @@ fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
         cx.span_fatal(best_fail_spot, best_fail_msg);
     }
 
-    let exp: @fn(ext_ctxt, span, &[ast::token_tree]) -> MacResult =
+    let exp: @fn(@ext_ctxt, span, &[ast::token_tree]) -> MacResult =
         |cx, sp, arg| generic_extension(cx, sp, name, arg, lhses, rhses);
 
     return MRDef(MacroDef{
index 589b7693f9e3a4d5ea66cacdaa9a60d59d452fe1..908fbd44825106ab58bbbe65bb3ce620db70da33 100644 (file)
@@ -34,7 +34,7 @@ struct TtFrame {
 }
 
 pub struct TtReader {
-    sp_diag: span_handler,
+    sp_diag: @span_handler,
     interner: @ident_interner,
     // the unzipped tree:
     cur: @mut TtFrame,
@@ -50,7 +50,7 @@ pub struct TtReader {
 /** This can do Macro-By-Example transcription. On the other hand, if
  *  `src` contains no `tt_seq`s and `tt_nonterminal`s, `interp` can (and
  *  should) be none. */
-pub fn new_tt_reader(sp_diag: span_handler,
+pub fn new_tt_reader(sp_diag: @span_handler,
                      itr: @ident_interner,
                      interp: Option<std::oldmap::HashMap<ident,@named_match>>,
                      +src: ~[ast::token_tree])
index 15097f57b02e03e1fc830757a3b8af30f43e8aec..1626c55e7211ea9b6ab0fb07b7ad276d02071452 100644 (file)
@@ -48,26 +48,26 @@ pub trait ast_fold {
 
 pub struct AstFoldFns {
     //unlike the others, item_ is non-trivial
-    fold_crate: @fn(&crate_, span, ast_fold) -> (crate_, span),
-    fold_view_item: @fn(view_item_, ast_fold) -> view_item_,
-    fold_foreign_item: @fn(@foreign_item, ast_fold) -> @foreign_item,
-    fold_item: @fn(@item, ast_fold) -> Option<@item>,
-    fold_struct_field: @fn(@struct_field, ast_fold) -> @struct_field,
-    fold_item_underscore: @fn(&item_, ast_fold) -> item_,
-    fold_method: @fn(@method, ast_fold) -> @method,
-    fold_block: @fn(&blk_, span, ast_fold) -> (blk_, span),
-    fold_stmt: @fn(&stmt_, span, ast_fold) -> (stmt_, span),
-    fold_arm: @fn(&arm, ast_fold) -> arm,
-    fold_pat: @fn(&pat_, span, ast_fold) -> (pat_, span),
-    fold_decl: @fn(&decl_, span, ast_fold) -> (decl_, span),
-    fold_expr: @fn(&expr_, span, ast_fold) -> (expr_, span),
-    fold_ty: @fn(&ty_, span, ast_fold) -> (ty_, span),
-    fold_mod: @fn(&_mod, ast_fold) -> _mod,
-    fold_foreign_mod: @fn(&foreign_mod, ast_fold) -> foreign_mod,
-    fold_variant: @fn(&variant_, span, ast_fold) -> (variant_, span),
-    fold_ident: @fn(ident, ast_fold) -> ident,
-    fold_path: @fn(@path, ast_fold) -> path,
-    fold_local: @fn(&local_, span, ast_fold) -> (local_, span),
+    fold_crate: @fn(&crate_, span, @ast_fold) -> (crate_, span),
+    fold_view_item: @fn(view_item_, @ast_fold) -> view_item_,
+    fold_foreign_item: @fn(@foreign_item, @ast_fold) -> @foreign_item,
+    fold_item: @fn(@item, @ast_fold) -> Option<@item>,
+    fold_struct_field: @fn(@struct_field, @ast_fold) -> @struct_field,
+    fold_item_underscore: @fn(&item_, @ast_fold) -> item_,
+    fold_method: @fn(@method, @ast_fold) -> @method,
+    fold_block: @fn(&blk_, span, @ast_fold) -> (blk_, span),
+    fold_stmt: @fn(&stmt_, span, @ast_fold) -> (stmt_, span),
+    fold_arm: @fn(&arm, @ast_fold) -> arm,
+    fold_pat: @fn(&pat_, span, @ast_fold) -> (pat_, span),
+    fold_decl: @fn(&decl_, span, @ast_fold) -> (decl_, span),
+    fold_expr: @fn(&expr_, span, @ast_fold) -> (expr_, span),
+    fold_ty: @fn(&ty_, span, @ast_fold) -> (ty_, span),
+    fold_mod: @fn(&_mod, @ast_fold) -> _mod,
+    fold_foreign_mod: @fn(&foreign_mod, @ast_fold) -> foreign_mod,
+    fold_variant: @fn(&variant_, span, @ast_fold) -> (variant_, span),
+    fold_ident: @fn(ident, @ast_fold) -> ident,
+    fold_path: @fn(@path, @ast_fold) -> path,
+    fold_local: @fn(&local_, span, @ast_fold) -> (local_, span),
     map_exprs: @fn(@fn(@expr) -> @expr, &[@expr]) -> ~[@expr],
     new_id: @fn(node_id) -> node_id,
     new_span: @fn(span) -> span
@@ -436,8 +436,8 @@ fn noop_fold_decl(d: &decl_, fld: @ast_fold) -> decl_ {
     }
 }
 
-pub fn wrap<T>(f: @fn(&T, ast_fold) -> T)
-            -> @fn(&T, span, ast_fold) -> (T, span) {
+pub fn wrap<T>(f: @fn(&T, @ast_fold) -> T)
+            -> @fn(&T, span, @ast_fold) -> (T, span) {
     let result: @fn(&T, span, @ast_fold) -> (T, span) = |x, s, fld| {
         (f(x, fld), s)
     };
@@ -879,13 +879,13 @@ fn new_span(@self, span: span) -> span {
     }
 }
 
-pub impl ast_fold {
+pub impl @ast_fold {
     fn fold_attributes(&self, attrs: ~[attribute]) -> ~[attribute] {
         attrs.map(|x| fold_attribute_(*x, *self))
     }
 }
 
-pub fn make_fold(afp: ast_fold_fns) -> ast_fold {
+pub fn make_fold(afp: ast_fold_fns) -> @ast_fold {
     afp as @ast_fold
 }
 
index 360cdebc6702b1434d98bcf31eda3095c0a6f99b..b6ec3aff44d1d750368ef20a1204f18afe247ef4 100644 (file)
@@ -256,7 +256,7 @@ fn read_block_comment(rdr: @mut StringReader,
         while level > 0 {
             debug!("=== block comment level %d", level);
             if is_eof(rdr) {
-                (rdr as reader).fatal(~"unterminated block comment");
+                (rdr as @reader).fatal(~"unterminated block comment");
             }
             if rdr.curr == '\n' {
                 trim_whitespace_prefix_and_push_line(&mut lines, curr_line,
@@ -319,9 +319,11 @@ pub struct lit {
     pos: BytePos
 }
 
-pub fn gather_comments_and_literals(span_diagnostic: diagnostic::span_handler,
+pub fn gather_comments_and_literals(span_diagnostic:
+                                    @diagnostic::span_handler,
                                     +path: ~str,
-                                    srdr: io::Reader) -> (~[cmnt], ~[lit]) {
+                                    srdr: @io::Reader)
+                                 -> (~[cmnt], ~[lit]) {
     let src = @str::from_bytes(srdr.read_whole_stream());
     let itr = parse::token::mk_fake_ident_interner();
     let cm = CodeMap::new();
index c7b9a769293d6b32eaa26ee4b1925b0036693b54..1b64a9a6275c1be564b4065cfcc1e29fa06eb784 100644 (file)
@@ -47,7 +47,7 @@ pub fn seq_sep_none() -> SeqSep {
     }
 }
 
-pub fn token_to_str(reader: reader, token: &token::Token) -> ~str {
+pub fn token_to_str(reader: @reader, token: &token::Token) -> ~str {
     token::to_str(reader.interner(), token)
 }
 
index ab57d177112936cf81459bd4ba89cfe3155e89a4..09ffd79c246e3ae54bc99c330ecca9075ae8a61a 100644 (file)
@@ -31,17 +31,17 @@ pub trait reader {
     fn is_eof(@mut self) -> bool;
     fn next_token(@mut self) -> TokenAndSpan;
     fn fatal(@mut self, ~str) -> !;
-    fn span_diag(@mut self) -> span_handler;
+    fn span_diag(@mut self) -> @span_handler;
     pure fn interner(@mut self) -> @token::ident_interner;
     fn peek(@mut self) -> TokenAndSpan;
-    fn dup(@mut self) -> reader;
+    fn dup(@mut self) -> @reader;
 }
 
 #[deriving_eq]
 pub struct TokenAndSpan {tok: token::Token, sp: span}
 
 pub struct StringReader {
-    span_diagnostic: span_handler,
+    span_diagnostic: @span_handler,
     src: @~str,
     // The absolute offset within the codemap of the next character to read
     pos: BytePos,
@@ -58,7 +58,7 @@ pub struct StringReader {
     peek_span: span
 }
 
-pub fn new_string_reader(span_diagnostic: span_handler,
+pub fn new_string_reader(span_diagnostic: @span_handler,
                          filemap: @codemap::FileMap,
                          itr: @token::ident_interner)
                       -> @mut StringReader {
@@ -68,7 +68,7 @@ pub fn new_string_reader(span_diagnostic: span_handler,
 }
 
 /* For comments.rs, which hackily pokes into 'pos' and 'curr' */
-pub fn new_low_level_string_reader(span_diagnostic: span_handler,
+pub fn new_low_level_string_reader(span_diagnostic: @span_handler,
                                    filemap: @codemap::FileMap,
                                    itr: @token::ident_interner)
                                 -> @mut StringReader {
@@ -121,7 +121,7 @@ fn next_token(@mut self) -> TokenAndSpan {
     fn fatal(@mut self, m: ~str) -> ! {
         self.span_diagnostic.span_fatal(copy self.peek_span, m)
     }
-    fn span_diag(@mut self) -> span_handler { self.span_diagnostic }
+    fn span_diag(@mut self) -> @span_handler { self.span_diagnostic }
     pure fn interner(@mut self) -> @token::ident_interner { self.interner }
     fn peek(@mut self) -> TokenAndSpan {
         TokenAndSpan {
@@ -129,7 +129,7 @@ fn peek(@mut self) -> TokenAndSpan {
             sp: copy self.peek_span,
         }
     }
-    fn dup(@mut self) -> reader { dup_string_reader(self) as reader }
+    fn dup(@mut self) -> @reader { dup_string_reader(self) as @reader }
 }
 
 impl reader for TtReader {
@@ -138,7 +138,7 @@ fn next_token(@mut self) -> TokenAndSpan { tt_next_token(self) }
     fn fatal(@mut self, m: ~str) -> ! {
         self.sp_diag.span_fatal(copy self.cur_span, m);
     }
-    fn span_diag(@mut self) -> span_handler { self.sp_diag }
+    fn span_diag(@mut self) -> @span_handler { self.sp_diag }
     pure fn interner(@mut self) -> @token::ident_interner { self.interner }
     fn peek(@mut self) -> TokenAndSpan {
         TokenAndSpan {
@@ -146,7 +146,7 @@ fn peek(@mut self) -> TokenAndSpan {
             sp: copy self.cur_span,
         }
     }
-    fn dup(@mut self) -> reader { dup_tt_reader(self) as reader }
+    fn dup(@mut self) -> @reader { dup_tt_reader(self) as @reader }
 }
 
 // EFFECT: advance peek_tok and peek_span to refer to the next token.
index fd84f8670686b5aafc16c9f25942209dc87ad598..8272ebfb6d8e8b63b5ea17f593d20fe6a6f14c5f 100644 (file)
@@ -48,7 +48,7 @@
 pub struct ParseSess {
     cm: @codemap::CodeMap,
     next_id: node_id,
-    span_diagnostic: span_handler,
+    span_diagnostic: @span_handler,
     interner: @ident_interner,
 }
 
@@ -62,8 +62,9 @@ pub fn new_parse_sess(demitter: Option<Emitter>) -> @mut ParseSess {
     }
 }
 
-pub fn new_parse_sess_special_handler(sh: span_handler, cm: @codemap::CodeMap)
-    -> @mut ParseSess {
+pub fn new_parse_sess_special_handler(sh: @span_handler,
+                                      cm: @codemap::CodeMap)
+                                   -> @mut ParseSess {
     @mut ParseSess {
         cm: cm,
         next_id: 1,
@@ -201,20 +202,19 @@ pub fn next_node_id(sess: @mut ParseSess) -> node_id {
     return rv;
 }
 
-pub fn new_parser_from_source_str(
-    sess: @mut ParseSess,
-    +cfg: ast::crate_cfg,
-    +name: ~str,
-    +ss: codemap::FileSubstr,
-    source: @~str
-) -> Parser {
+pub fn new_parser_from_source_str(sess: @mut ParseSess,
+                                  +cfg: ast::crate_cfg,
+                                  +name: ~str,
+                                  +ss: codemap::FileSubstr,
+                                  source: @~str)
+                               -> Parser {
     let filemap = sess.cm.new_filemap_w_substr(name, ss, source);
     let srdr = lexer::new_string_reader(
         copy sess.span_diagnostic,
         filemap,
         sess.interner
     );
-    Parser(sess, cfg, srdr as reader)
+    Parser(sess, cfg, srdr as @reader)
 }
 
 /// Read the entire source file, return a parser
@@ -227,12 +227,10 @@ pub fn new_parser_result_from_file(
     match io::read_whole_file_str(path) {
         Ok(src) => {
             let filemap = sess.cm.new_filemap(path.to_str(), @src);
-            let srdr = lexer::new_string_reader(
-                copy sess.span_diagnostic,
-                filemap,
-                sess.interner
-            );
-            Ok(Parser(sess, cfg, srdr as reader))
+            let srdr = lexer::new_string_reader(copy sess.span_diagnostic,
+                                                filemap,
+                                                sess.interner);
+            Ok(Parser(sess, cfg, srdr as @reader))
 
         }
         Err(e) => Err(e)
@@ -281,7 +279,7 @@ pub fn new_parser_from_tts(
         None,
         tts
     );
-    Parser(sess, cfg, trdr as reader)
+    Parser(sess, cfg, trdr as @reader)
 }
 
 // abort if necessary
index 77ba27cf423b70103192067bbedaf6b9cc984b7e..170a1a3240ee0e1193ad171c806b9e3383560e46 100644 (file)
@@ -215,8 +215,8 @@ struct ParsedItemsAndViewItems {
 
 pub fn Parser(sess: @mut ParseSess,
               +cfg: ast::crate_cfg,
-              +rdr: reader) -> Parser {
-
+              +rdr: @reader)
+           -> Parser {
     let tok0 = copy rdr.next_token();
     let interner = rdr.interner();
 
@@ -254,7 +254,7 @@ pub struct Parser {
     tokens_consumed: @mut uint,
     restriction: @mut restriction,
     quote_depth: @mut uint, // not (yet) related to the quasiquoter
-    reader: reader,
+    reader: @reader,
     interner: @token::ident_interner,
     keywords: HashMap<~str, ()>,
     strict_keywords: HashMap<~str, ()>,
index 846560636463f063d6265eb1796a92af0644eb63..724e61daea7e74611e841662b73021a6e7170246 100644 (file)
@@ -76,7 +76,7 @@ pub fn end(s: @ps) {
     pp::end(s.s);
 }
 
-pub fn rust_printer(writer: io::Writer, intr: @ident_interner) -> @ps {
+pub fn rust_printer(writer: @io::Writer, intr: @ident_interner) -> @ps {
     return @ps {
         s: pp::mk_printer(writer, default_columns),
         cm: None::<@CodeMap>,
@@ -100,10 +100,15 @@ pub fn rust_printer(writer: io::Writer, intr: @ident_interner) -> @ps {
 // Requires you to pass an input filename and reader so that
 // it can scan the input text for comments and literals to
 // copy forward.
-pub fn print_crate(cm: @CodeMap, intr: @ident_interner,
-                   span_diagnostic: diagnostic::span_handler,
-                   crate: @ast::crate, filename: ~str, in: io::Reader,
-                   out: io::Writer, ann: pp_ann, is_expanded: bool) {
+pub fn print_crate(cm: @CodeMap,
+                   intr: @ident_interner,
+                   span_diagnostic: @diagnostic::span_handler,
+                   crate: @ast::crate,
+                   filename: ~str,
+                   in: @io::Reader,
+                   out: @io::Writer,
+                   ann: pp_ann,
+                   is_expanded: bool) {
     let (cmnts, lits) = comments::gather_comments_and_literals(
         span_diagnostic,
         copy filename,
index afe7d4a6e8b2c655cdae2bb6477ebcfcd8e2162b..bd1b9d84e077499ad1a02512a4d2319c37029d26 100644 (file)
@@ -13,7 +13,7 @@
 
 pub trait i<T> { }
 
-pub fn f<T>() -> i<T> {
+pub fn f<T>() -> @i<T> {
     impl<T> i<T> for () { }
 
     @() as @i<T>
index 092fb4a5b6675c2f34ff19db1f309c0e32d43713..9133b80aa1e2b46d4fbd0891f6a5b2b342cf2112 100644 (file)
@@ -58,6 +58,6 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 }
 
 fn main() {
-  let nyan : noisy  = @cat(0, 2, ~"nyan") as @noisy;
+  let nyan : @noisy  = @cat(0, 2, ~"nyan") as @noisy;
   nyan.eat(); //~ ERROR type `@noisy` does not implement any method in scope named `eat`
 }
index e0651a68fa9d45bca4f6c4dc73c13207b2e8e024..4f8269bb11b42bb334ce961cd8fb5b36b8ea2770 100644 (file)
@@ -14,14 +14,14 @@ impl<A:Copy> repeat<A> for @A {
     fn get() -> A { *self }
 }
 
-fn repeater<A:Copy>(v: @A) -> repeat<A> {
+fn repeater<A:Copy>(v: @A) -> @repeat<A> {
     // Note: owned kind is not necessary as A appears in the trait type
-    @v as repeat::<A> // No
+    @v as @repeat::<A> // No
 }
 
 fn main() {
     // Error results because the type of is inferred to be
-    // repeat<&blk/int> where blk is the lifetime of the block below.
+    // @repeat<&blk/int> where blk is the lifetime of the block below.
 
     let y = { //~ ERROR reference is not valid
         let x: &blk/int = &3;
index fbbac6e0a641a81e70bbdad5269c872b043f997e..391b65e3c818aa5622b6b8390ef78d556954470a 100644 (file)
@@ -26,22 +26,22 @@ fn to_foo<T:Copy>(t: T) {
     // the fn body itself.
     let v = &3;
     struct F<T> { f: T }
-    let x = @F {f:t} as foo;
+    let x = @F {f:t} as @foo;
     fail_unless!(x.foo(v) == 3);
 }
 
-fn to_foo_2<T:Copy>(t: T) -> foo {
+fn to_foo_2<T:Copy>(t: T) -> @foo {
     // Not OK---T may contain borrowed ptrs and it is going to escape
     // as part of the returned foo value
     struct F<T> { f: T }
-    @F {f:t} as foo //~ ERROR value may contain borrowed pointers; use `&static` bound
+    @F {f:t} as @foo //~ ERROR value may contain borrowed pointers; use `&static` bound
 }
 
-fn to_foo_3<T:Copy + &static>(t: T) -> foo {
+fn to_foo_3<T:Copy + &static>(t: T) -> @foo {
     // OK---T may escape as part of the returned foo value, but it is
     // owned and hence does not contain borrowed ptrs
     struct F<T> { f: T }
-    @F {f:t} as foo
+    @F {f:t} as @foo
 }
 
 fn main() {
index 30f6a5f9b2dd732709d709d31574408c747494c7..a92a764afe746c241aa9013789f059a157caa3e3 100644 (file)
 
 trait foo { fn foo(); }
 
-fn to_foo<T:Copy + foo>(t: T) -> foo {
+fn to_foo<T:Copy + foo>(t: T) -> @foo {
     @t as @foo //~ ERROR value may contain borrowed pointers; use `&static` bound
 }
 
-fn to_foo2<T:Copy + foo + &static>(t: T) -> foo {
+fn to_foo2<T:Copy + foo + &static>(t: T) -> @foo {
     @t as @foo
 }
 
index c8384c188310e5264f87826056253f424f080c57..8b6c6b8410ac0e76ceef5115d7c41118c6f4881f 100644 (file)
@@ -15,7 +15,7 @@
 
 fn main() {
     let x: @Map<~str, ~str> = @LinearMap::new::<~str, ~str>() as
-        Map::<~str, ~str>;
+        @Map::<~str, ~str>;
     let y: @Map<uint, ~str> = @x;
     //~^ ERROR mismatched types: expected `@core::container::Map<uint,~str>`
 }
index 35bef5a407a5574059ad0fc4fccd66a554588f51..92d1aab781c4b18137a80b5fb2f973ae054a3fca 100644 (file)
@@ -22,7 +22,7 @@ fn a_fn1(e: an_enum<'a>) -> an_enum<'b> {
     return e; //~ ERROR mismatched types: expected `an_enum/&b` but found `an_enum/&a`
 }
 
-fn a_fn2(e: a_trait<'a>) -> a_trait<'b> {
+fn a_fn2(e: @a_trait<'a>) -> @a_trait<'b> {
     return e; //~ ERROR mismatched types: expected `@a_trait/&b` but found `@a_trait/&a`
 }
 
index 32702663c6e06904fe54f1006ebf2d220700145f..93d493314fdcee6b6f2eec72f4ff1ccc6141b7b4 100644 (file)
@@ -18,7 +18,7 @@ trait foo<'self> {
 }
 
 struct with_foo<'self> {
-    f: foo<'self>
+    f: @foo<'self>
 }
 
 trait set_foo_foo {
index f4e41d951aa2aab4d30c4fc5b5053f16f6ecef01..8104f62595cb9dec3b7062c455f53294c1bb1fdd 100644 (file)
@@ -27,12 +27,12 @@ fn get_ctxt() -> &'self ctxt { //~ ERROR method `get_ctxt` has an incompatible t
 
 }
 
-fn get_v(gc: get_ctxt) -> uint {
+fn get_v(gc: @get_ctxt) -> uint {
     gc.get_ctxt().v
 }
 
 fn main() {
     let ctxt = ctxt { v: 22u };
     let hc = has_ctxt { c: &ctxt };
-    fail_unless!(get_v(@hc as get_ctxt) == 22u);
+    fail_unless!(get_v(@hc as @get_ctxt) == 22u);
 }
index 12ab58ec8907e58005292307f0d0356ec28315bf..d76bc798705fe34b9aba07c5c181afe3594fcd6e 100644 (file)
@@ -20,10 +20,10 @@ impl<'self> get_ctxt<'self> for has_ctxt<'self> {
     fn get_ctxt() -> &self/ctxt { self.c }
 }
 
-fn make_gc() -> get_ctxt  {
+fn make_gc() -> @get_ctxt  {
     let ctxt = ctxt { v: 22u };
     let hc = has_ctxt { c: &ctxt }; //~ ERROR illegal borrow
-    return @hc as get_ctxt;
+    return @hc as @get_ctxt;
 }
 
 fn main() {
index a10c239617ec96a107ca7395fd249e17b17533cb..414d848a96680cb36b2596e205ceec50538234fd 100644 (file)
@@ -12,7 +12,7 @@ trait get_ctxt {
     fn get_ctxt() -> &self/uint;
 }
 
-fn make_gc1(gc: get_ctxt/&a) -> get_ctxt/&b  {
+fn make_gc1(gc: @get_ctxt/&a) -> @get_ctxt/&b  {
     return gc; //~ ERROR mismatched types: expected `@get_ctxt/&b` but found `@get_ctxt/&a`
 }
 
@@ -24,8 +24,8 @@ impl get_ctxt/&self for Foo/&self {
     fn get_ctxt() -> &self/uint { self.r }
 }
 
-fn make_gc2(foo: Foo/&a) -> get_ctxt/&b  {
-    return @foo as get_ctxt; //~ ERROR cannot infer an appropriate lifetime
+fn make_gc2(foo: Foo/&a) -> @get_ctxt/&b  {
+    return @foo as @get_ctxt; //~ ERROR cannot infer an appropriate lifetime
 }
 
 fn main() {
index 9569e5f1e8210fe58383f4a5813c7ca048ac80e5..1699534216eb941ec96ec6f1ea315d1b4bd21b97 100644 (file)
@@ -24,7 +24,7 @@ impl<T:Copy> box_trait<T> for box_impl<T> {
     fn set(t: T) { self.f = t; }
 }
 
-fn set_box_trait<T>(b: box_trait<@const T>, v: @const T) {
+fn set_box_trait<T>(b: @box_trait<@const T>, v: @const T) {
     b.set(v);
 }
 
@@ -34,7 +34,7 @@ fn set_box_impl<T>(b: box_impl<@const T>, v: @const T) {
 
 fn main() {
     let b = box_impl::<@int>(box::<@int> {f: @3});
-    set_box_trait(@b as box_trait::<@int>, @mut 5);
+    set_box_trait(@b as @box_trait::<@int>, @mut 5);
     //~^ ERROR values differ in mutability
     set_box_impl(b, @mut 5);
     //~^ ERROR values differ in mutability
index a00e63b60d7d52156749fd50d8a12c97a1377a5d..e63a1dc3563d5e6b492c66bf566cffc83d37d787 100644 (file)
@@ -15,5 +15,5 @@ impl bar for uint { fn dup() -> uint { self } fn blah<X>() {} }
 fn main() {
     10i.dup::<int>(); //~ ERROR does not take type parameters
     10i.blah::<int, int>(); //~ ERROR incorrect number of type parameters
-    (@10 as bar).dup(); //~ ERROR contains a self-type
+    (@10 as @bar).dup(); //~ ERROR contains a self-type
 }
index c825118fa984cacb69b8214e6d4642e7a4420b44..514448c9644fc54c3ca40936f6e7c380bb8d80db 100644 (file)
@@ -24,7 +24,7 @@ fn gimme_an_a<A:TraitA>(a: A) -> int {
 
 fn call_it<B:TraitB>(b: B)  -> int {
     let y = 4u;
-    b.gimme_an_a(y) //~ ERROR failed to find an implementation of trait @TraitA
+    b.gimme_an_a(y) //~ ERROR failed to find an implementation of trait TraitA
 }
 
 fn main() {
index 85ed524118b4f004209b4231e8ccb0f14c2c1e8b..fe32af7b15f6f3b8d49ef76d9b66a44fa3aeb492 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait clam<A:Copy> {
+trait c lam<A:Copy> {
   fn chowder(y: A);
 }
 struct foo<A> {
@@ -26,13 +26,13 @@ fn foo<A:Copy>(b: A) -> foo<A> {
     }
 }
 
-fn f<A:Copy>(x: clam<A>, a: A) {
+fn f<A:Copy>(x: @clam<A>, a: A) {
   x.chowder(a);
 }
 
 pub fn main() {
 
   let c = foo(42);
-  let d: clam<int> = @c as clam::<int>;
+  let d: @clam<int> = @c as @clam::<int>;
   f(d, c.x);
 }
index 14e27dce63d15b0f079c3c7f5fc660524be94641..ef6363043eed4207076cab3619e83a270139c9f3 100644 (file)
@@ -11,7 +11,7 @@
 trait hax { }
 impl<A> hax for A { }
 
-fn perform_hax<T:&static>(x: @T) -> hax {
+fn perform_hax<T:&static>(x: @T) -> @hax {
     @x as @hax
 }
 
index 64af4de46a242766276765844151462aa6f5fd52..323b5d8ed5ae94ae08d1da0879afb22891dd10da 100644 (file)
@@ -25,7 +25,7 @@ pub fn main() {
   //   let y = @({a: 4i});
   //    let z = @({a: 4i} as it);
   //    let z = @({a: true} as it);
-    let z = @(@true as it);
+    let z = @(@true as @it);
     //  x.f();
     // y.f();
     // (*z).f();
index bb6ed754ab676ed3d56908228d53f51134fc7ae9..75b0a6335528a3562ee7110fa6e5f422bb7dd00e 100644 (file)
@@ -14,9 +14,9 @@ impl<A:Copy> repeat<A> for @A {
     fn get() -> A { *self }
 }
 
-fn repeater<A:Copy>(v: @A) -> repeat<A> {
+fn repeater<A:Copy>(v: @A) -> @repeat<A> {
     // Note: owned kind is not necessary as A appears in the trait type
-    @v as repeat::<A> // No
+    @v as @repeat::<A> // No
 }
 
 pub fn main() {
index 88c317a3c0735f52321dae481d680a85ba076e3d..ecf30b206c58582a7737a2c3e7c0c53296612abc 100644 (file)
@@ -29,7 +29,7 @@ fn serialize<S:Serializer>(s: S) {
     }
 }
 
-impl Serializer for io::Writer {
+impl Serializer for @io::Writer {
 }
 
 pub fn main() {
index 22cdd4770777025ea3f27362d3744da7cfe692bb..cc12c1b7dd9f171459a7f3dd3a90add9a4e18f00 100644 (file)
@@ -22,7 +22,7 @@ fn get_ctxt() -> &self/Ctxt {
     }
 }
 
-fn get_v(gc: get_ctxt) -> uint {
+fn get_v(gc: @get_ctxt) -> uint {
     gc.get_ctxt().v
 }