about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-07-06 11:26:26 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-07-06 11:26:26 -0700
commitbbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c (patch)
treed9cb0046b2a608b4b44c54eacce7951326c65df2 /src/comp/syntax
parentec890fff23d80da97086e89f29ef7f8d14dbaab8 (diff)
downloadrust-bbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c.tar.gz
rust-bbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c.zip
rustc: Revert the conversion to interior vectors due to heap corruption
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast.rs30
-rw-r--r--src/comp/syntax/ext/base.rs5
-rw-r--r--src/comp/syntax/ext/fmt.rs11
-rw-r--r--src/comp/syntax/ext/simplext.rs6
-rw-r--r--src/comp/syntax/fold.rs19
-rw-r--r--src/comp/syntax/parse/eval.rs7
-rw-r--r--src/comp/syntax/parse/parser.rs165
-rw-r--r--src/comp/syntax/print/pprust.rs43
-rw-r--r--src/comp/syntax/util/interner.rs12
9 files changed, 121 insertions, 177 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 6b0a2f998bc..5f8e301d6e2 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -1,6 +1,4 @@
-// The Rust abstract syntax tree.
 
-import std::ivec;
 import std::option;
 import std::str;
 import std::vec;
@@ -17,11 +15,11 @@ type fn_ident = option::t[ident];
 // FIXME: with typestate constraint, could say
 // idents and types are the same length, and are
 // non-empty
-type path_ = rec(ident[] idents, (@ty)[] types);
+type path_ = rec(vec[ident] idents, vec[@ty] types);
 
 type path = spanned[path_];
 
-fn path_name(&path p) -> str { ret str::connect_ivec(p.node.idents, "::"); }
+fn path_name(&path p) -> str { ret str::connect(p.node.idents, "::"); }
 
 type crate_num = int;
 type node_id = int;
@@ -81,19 +79,19 @@ fn def_id_of_def(def d) -> def_id {
 
 // The set of meta_items that define the compilation environment of the crate,
 // used to drive conditional compilation
-type crate_cfg = (@meta_item)[];
+type crate_cfg = vec[@meta_item];
 
 type crate = spanned[crate_];
 
-type crate_ = rec((@crate_directive)[] directives,
+type crate_ = rec(vec[@crate_directive] directives,
                   _mod module,
-                  attribute[] attrs,
+                  vec[attribute] attrs,
                   crate_cfg config);
 
 tag crate_directive_ {
-    cdir_src_mod(ident, option::t[filename], attribute[]);
+    cdir_src_mod(ident, option::t[filename], vec[attribute]);
     cdir_dir_mod(ident, option::t[filename],
-                 (@crate_directive)[], attribute[]);
+                 vec[@crate_directive], vec[attribute]);
     cdir_view_item(@view_item);
     cdir_syntax(path);
     cdir_auth(path, _auth);
@@ -105,7 +103,7 @@ type meta_item = spanned[meta_item_];
 
 tag meta_item_ {
     meta_word(ident);
-    meta_list(ident, (@meta_item)[]);
+    meta_list(ident, vec[@meta_item]);
     meta_name_value(ident, lit);
 }
 
@@ -505,7 +503,7 @@ type variant = spanned[variant_];
 type view_item = spanned[view_item_];
 
 tag view_item_ {
-    view_item_use(ident, (@meta_item)[], node_id);
+    view_item_use(ident, vec[@meta_item], node_id);
     view_item_import(ident, vec[ident], node_id);
     view_item_import_glob(vec[ident], node_id);
     view_item_export(ident, node_id);
@@ -526,7 +524,7 @@ tag attr_style { attr_outer; attr_inner; }
 type attribute_ = rec(attr_style style, meta_item value);
 
 type item = rec(ident ident,
-                attribute[] attrs,
+                vec[attribute] attrs,
                 node_id id, // For objs and resources, this is the type def_id
                 item_ node,
                 span span);
@@ -544,7 +542,7 @@ tag item_ {
 }
 
 type native_item = rec(ident ident,
-                       attribute[] attrs,
+                       vec[attribute] attrs,
                        native_item_ node,
                        node_id id,
                        span span);
@@ -634,11 +632,11 @@ fn ternary_to_if(&@expr e) -> @ast::expr {
 
 // Path stringification
 fn path_to_str(&ast::path pth) -> str {
-    auto result = str::connect_ivec(pth.node.idents, "::");
-    if (ivec::len[@ast::ty](pth.node.types) > 0u) {
+    auto result = str::connect(pth.node.idents, "::");
+    if (vec::len[@ast::ty](pth.node.types) > 0u) {
         fn f(&@ast::ty t) -> str { ret print::pprust::ty_to_str(*t); }
         result += "[";
-        result += str::connect_ivec(ivec::map(f, pth.node.types), ",");
+        result += str::connect(vec::map(f, pth.node.types), ",");
         result += "]";
     }
     ret result;
diff --git a/src/comp/syntax/ext/base.rs b/src/comp/syntax/ext/base.rs
index 766dd9f3f28..a0ba306edfa 100644
--- a/src/comp/syntax/ext/base.rs
+++ b/src/comp/syntax/ext/base.rs
@@ -1,4 +1,3 @@
-import std::ivec;
 import std::vec;
 import std::option;
 import std::map::hashmap;
@@ -72,8 +71,8 @@ fn expr_to_str(&ext_ctxt cx, @ast::expr expr, str error) -> str {
 fn expr_to_ident(&ext_ctxt cx, @ast::expr expr, str error) -> ast::ident {
     alt(expr.node) {
         case (ast::expr_path(?p)) {
-            if (ivec::len(p.node.types) > 0u 
-                    || ivec::len(p.node.idents) != 1u) {
+            if (vec::len(p.node.types) > 0u 
+                || vec::len(p.node.idents) != 1u) {
                 cx.span_fatal(expr.span, error);
             } else {
                 ret p.node.idents.(0);
diff --git a/src/comp/syntax/ext/fmt.rs b/src/comp/syntax/ext/fmt.rs
index c7e2787d502..1ea2d694374 100644
--- a/src/comp/syntax/ext/fmt.rs
+++ b/src/comp/syntax/ext/fmt.rs
@@ -60,9 +60,10 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces,
         auto binexpr = ast::expr_binary(ast::add, lhs, rhs);
         ret @rec(id=cx.next_id(), node=binexpr, span=sp);
     }
-    fn make_path_expr(&ext_ctxt cx, span sp, &ast::ident[] idents)
+    fn make_path_expr(&ext_ctxt cx, span sp, vec[ast::ident] idents)
        -> @ast::expr {
-        auto path = rec(idents=idents, types=~[]);
+        let vec[@ast::ty] types = [];
+        auto path = rec(idents=idents, types=types);
         auto sp_path = rec(node=path, span=sp);
         auto pathexpr = ast::expr_path(sp_path);
         ret @rec(id=cx.next_id(), node=pathexpr, span=sp);
@@ -72,7 +73,7 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces,
         auto vecexpr = ast::expr_vec(exprs, ast::imm, ast::sk_rc);
         ret @rec(id=cx.next_id(), node=vecexpr, span=sp);
     }
-    fn make_call(&ext_ctxt cx, span sp, &ast::ident[] fn_path,
+    fn make_call(&ext_ctxt cx, span sp, vec[ast::ident] fn_path,
                  vec[@ast::expr] args) -> @ast::expr {
         auto pathexpr = make_path_expr(cx, sp, fn_path);
         auto callexpr = ast::expr_call(pathexpr, args);
@@ -91,11 +92,11 @@ fn pieces_to_expr(&ext_ctxt cx, span sp, vec[piece] pieces,
         auto recexpr = ast::expr_rec(astfields, option::none[@ast::expr]);
         ret @rec(id=cx.next_id(), node=recexpr, span=sp);
     }
-    fn make_path_vec(str ident) -> str[] {
+    fn make_path_vec(str ident) -> vec[str] {
         // FIXME: #fmt can't currently be used from within std
         // because we're explicitly referencing the 'std' crate here
 
-        ret ~["std", "extfmt", "rt", ident];
+        ret ["std", "extfmt", "rt", ident];
     }
     fn make_rt_path_expr(&ext_ctxt cx, span sp, str ident) ->
        @ast::expr {
diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs
index 53b37da6c27..e214524f0b7 100644
--- a/src/comp/syntax/ext/simplext.rs
+++ b/src/comp/syntax/ext/simplext.rs
@@ -1,7 +1,6 @@
 use std;
 
 import codemap::span;
-import std::ivec;
 import std::vec;
 import std::option;
 import vec::map;
@@ -51,7 +50,7 @@ fn subst_ident(&ext_ctxt cx, &vec[@ast::expr] args,
 fn subst_path(&ext_ctxt cx, &vec[@ast::expr] args, 
               @vec[ident] param_names, &path_ p, ast_fold fld) -> path_ {
     // Don't substitute into qualified names.
-    if (ivec::len(p.types) > 0u || ivec::len(p.idents) != 1u) { ret p; }
+    if (len(p.types) > 0u || len(p.idents) != 1u) { ret p; }
     alt (position(p.idents.(0), *param_names)) {
         case (some[uint](?idx)) {
             alt (args.(idx).node) {
@@ -76,8 +75,7 @@ fn subst_expr(&ext_ctxt cx, &vec[@ast::expr] args, @vec[ident] param_names,
     ret alt(e) {
         case (expr_path(?p)){
             // Don't substitute into qualified names.
-            if (ivec::len(p.node.types) > 0u ||
-                    ivec::len(p.node.idents) != 1u) { e }
+            if (len(p.node.types) > 0u || len(p.node.idents) != 1u) { e }
             alt (position(p.node.idents.(0), *param_names)) {
                 case (some[uint](?idx)) {
                     args.(idx).node
diff --git a/src/comp/syntax/fold.rs b/src/comp/syntax/fold.rs
index ce512d00655..f36eeddeeb6 100644
--- a/src/comp/syntax/fold.rs
+++ b/src/comp/syntax/fold.rs
@@ -1,7 +1,6 @@
 import syntax::codemap::span;
 import ast::*;
 
-import std::ivec;
 import std::vec;
 import std::option;
 import vec::map;
@@ -103,7 +102,7 @@ fn fold_meta_item_(&@meta_item mi, ast_fold fld) -> @meta_item {
                  case (meta_word(?id)) { meta_word(fld.fold_ident(id)) }
                  case (meta_list(?id, ?mis)) {
                      auto fold_meta_item = bind fold_meta_item_(_,fld);
-                     meta_list(id, ivec::map(fold_meta_item, mis))
+                     meta_list(id, map(fold_meta_item, mis))
                  }
                  case (meta_name_value(?id,?s)) {
                      meta_name_value(fld.fold_ident(id),s)
@@ -131,10 +130,10 @@ fn noop_fold_crate(&crate_ c, ast_fold fld) -> crate_ {
     auto fold_meta_item = bind fold_meta_item_(_,fld);
     auto fold_attribute = bind fold_attribute_(_,fold_meta_item);
 
-    ret rec(directives=ivec::map(fld.fold_crate_directive, c.directives),
+    ret rec(directives=map(fld.fold_crate_directive, c.directives),
             module=fld.fold_mod(c.module),
-            attrs=ivec::map(fold_attribute, c.attrs),
-            config=ivec::map(fold_meta_item, c.config));
+            attrs=map(fold_attribute, c.attrs),
+            config=map(fold_meta_item, c.config));
 }
 
 fn noop_fold_crate_directive(&crate_directive_ cd, ast_fold fld) 
@@ -145,7 +144,7 @@ fn noop_fold_crate_directive(&crate_directive_ cd, ast_fold fld)
                 }
         case(cdir_dir_mod(?id,?fname,?cds,?attrs)) {
             cdir_dir_mod(fld.fold_ident(id),fname,
-                         ivec::map(fld.fold_crate_directive, cds), attrs)
+                         map(fld.fold_crate_directive, cds), attrs)
                 }
         case(cdir_view_item(?vi)) { 
             cdir_view_item(fld.fold_view_item(vi))
@@ -166,7 +165,7 @@ fn noop_fold_native_item(&@native_item ni, ast_fold fld) -> @native_item {
     auto fold_attribute = bind fold_attribute_(_,fold_meta_item);
 
     ret @rec(ident=fld.fold_ident(ni.ident),
-             attrs=ivec::map(fold_attribute, ni.attrs),
+             attrs=map(fold_attribute, ni.attrs),
              node=alt (ni.node) {
                  case (native_item_ty) { native_item_ty }
                  case (native_item_fn(?st, ?fdec, ?typms)) {
@@ -188,7 +187,7 @@ fn noop_fold_item(&@item i, ast_fold fld) -> @item {
     auto fold_attribute = bind fold_attribute_(_,fold_meta_item);
 
     ret @rec(ident=fld.fold_ident(i.ident),
-             attrs=ivec::map(fold_attribute,i.attrs),
+             attrs=map(fold_attribute,i.attrs),
              id=i.id, node=fld.fold_item_underscore(i.node),
              span=i.span);
 }
@@ -486,8 +485,8 @@ fn noop_fold_ident(&ident i, ast_fold fld) -> ident {
 }
 
 fn noop_fold_path(&path_ p, ast_fold fld) -> path_ {
-    ret rec(idents=ivec::map(fld.fold_ident, p.idents),
-            types=ivec::map(fld.fold_ty, p.types));
+    ret rec(idents=map(fld.fold_ident, p.idents),
+            types=map(fld.fold_ty, p.types));
 }
 
 fn noop_fold_local(&local_ l, ast_fold fld) -> local_ {
diff --git a/src/comp/syntax/parse/eval.rs b/src/comp/syntax/parse/eval.rs
index d3806454b06..ca26e9f8128 100644
--- a/src/comp/syntax/parse/eval.rs
+++ b/src/comp/syntax/parse/eval.rs
@@ -24,7 +24,7 @@ type ctx =
          mutable uint chpos,
          ast::crate_cfg cfg);
 
-fn eval_crate_directives(ctx cx, &(@ast::crate_directive)[] cdirs,
+fn eval_crate_directives(ctx cx, vec[@ast::crate_directive] cdirs,
                          str prefix, &mutable vec[@ast::view_item] view_items,
                          &mutable vec[@ast::item] items) {
     for (@ast::crate_directive sub_cdir in cdirs) {
@@ -32,8 +32,9 @@ fn eval_crate_directives(ctx cx, &(@ast::crate_directive)[] cdirs,
     }
 }
 
-fn eval_crate_directives_to_mod(ctx cx, &(@ast::crate_directive)[] cdirs,
-                                str prefix) -> ast::_mod {
+fn eval_crate_directives_to_mod(ctx cx,
+                                vec[@ast::crate_directive] cdirs, str prefix)
+   -> ast::_mod {
     let vec[@ast::view_item] view_items = [];
     let vec[@ast::item] items = [];
     eval_crate_directives(cx, cdirs, prefix, view_items, items);
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 8db9a068bbe..1e4ca951d07 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1,6 +1,5 @@
 
 import std::io;
-import std::ivec;
 import std::vec;
 import std::str;
 import std::option;
@@ -410,18 +409,13 @@ fn parse_ty_postfix(@ast::ty orig_t, &parser p) -> @ast::ty {
             // This is explicit type parameter instantiation.
             auto seq = parse_seq_to_end(token::RBRACKET, some(token::COMMA),
                                         parse_ty, p);
-
-            // FIXME: Remove this vec->ivec conversion.
-            auto seq_ivec = ~[];
-            for (@ast::ty typ in seq) { seq_ivec += ~[typ]; }
-
             alt (orig_t.node) {
                 case (ast::ty_path(?pth, ?ann)) {
                     auto hi = p.get_hi_pos();
                     ret @spanned(lo, hi,
                                  ast::ty_path(spanned(lo, hi,
                                               rec(idents=pth.node.idents,
-                                                  types=seq_ivec)),
+                                                  types=seq)),
                                               ann));
                 }
                 case (_) {
@@ -591,24 +585,6 @@ fn parse_seq_to_end[T](token::token ket, option::t[token::token] sep,
     ret v;
 }
 
-fn parse_seq_to_end_ivec[T](token::token ket, option::t[token::token] sep,
-                            fn(&parser)->T  f, &parser p) -> T[] {
-    let bool first = true;
-    let T[] v = ~[];
-    while (p.peek() != ket) {
-        alt (sep) {
-            case (some(?t)) {
-                if (first) { first = false; } else { expect(p, t); }
-            }
-            case (_) { }
-        }
-        v += ~[f(p)];
-    }
-    expect(p, ket);
-    ret v;
-}
-
-
 fn parse_seq[T](token::token bra, token::token ket,
                 option::t[token::token] sep, fn(&parser) -> T  f, &parser p)
    -> ast::spanned[vec[T]] {
@@ -619,17 +595,6 @@ fn parse_seq[T](token::token bra, token::token ket,
     ret spanned(lo, hi, result);
 }
 
-fn parse_seq_ivec[T](token::token bra, token::token ket,
-                     option::t[token::token] sep,
-                     fn(&parser)->T  f, &parser p) -> ast::spanned[T[]] {
-    auto lo = p.get_lo_pos();
-    expect(p, bra);
-    auto result = parse_seq_to_end_ivec[T](ket, sep, f, p);
-    auto hi = p.get_hi_pos();
-    ret spanned(lo, hi, result);
-}
-
-
 fn parse_lit(&parser p) -> ast::lit {
     auto sp = p.get_span();
     let ast::lit_ lit = ast::lit_nil;
@@ -672,12 +637,12 @@ fn is_ident(token::token t) -> bool {
 fn parse_path(&parser p) -> ast::path {
     auto lo = p.get_lo_pos();
     auto hi = lo;
-    let ast::ident[] ids = ~[];
+    let vec[ast::ident] ids = [];
     while (true) {
         alt (p.peek()) {
             case (token::IDENT(?i, _)) {
                 hi = p.get_hi_pos();
-                ids += ~[p.get_str(i)];
+                ids += [p.get_str(i)];
                 p.bump();
                 if (p.peek() == token::MOD_SEP) { p.bump(); } else { break; }
             }
@@ -685,7 +650,7 @@ fn parse_path(&parser p) -> ast::path {
         }
     }
     hi = p.get_hi_pos();
-    ret spanned(lo, hi, rec(idents=ids, types=~[]));
+    ret spanned(lo, hi, rec(idents=ids, types=[]));
 }
 
 fn parse_path_and_ty_param_substs(&parser p) -> ast::path {
@@ -694,13 +659,8 @@ fn parse_path_and_ty_param_substs(&parser p) -> ast::path {
     if (p.peek() == token::LBRACKET) {
         auto seq = parse_seq(token::LBRACKET, token::RBRACKET,
                              some(token::COMMA), parse_ty, p);
-
-        // FIXME: Remove this vec->ivec conversion.
-        auto seq_ivec = ~[];
-        for (@ast::ty typ in seq.node) { seq_ivec += ~[typ]; }
-
         auto hi = p.get_hi_pos();
-        path = spanned(lo, hi, rec(idents=path.node.idents, types=seq_ivec));
+        path = spanned(lo, hi, rec(idents=path.node.idents, types=seq.node));
     }
     ret path;
 }
@@ -995,7 +955,7 @@ fn parse_syntax_ext(&parser p) -> @ast::expr {
 
 fn parse_syntax_ext_naked(&parser p, uint lo) -> @ast::expr {
     auto pth = parse_path(p);
-    if (ivec::len(pth.node.idents) == 0u) {
+    if (vec::len(pth.node.idents) == 0u) {
         p.fatal("expected a syntax expander name");
     }
     auto es = parse_seq(token::LPAREN, token::RPAREN,
@@ -1015,7 +975,7 @@ fn parse_syntax_ext_naked(&parser p, uint lo) -> @ast::expr {
 fn expand_syntax_ext(&parser p, span sp, &ast::path path,
                      vec[@ast::expr] args, option::t[str] body) ->
    ast::expr_ {
-    assert (ivec::len(path.node.idents) > 0u);
+    assert (vec::len(path.node.idents) > 0u);
     auto extname = path.node.idents.(0);
     alt (p.get_syntax_expanders().find(extname)) {
         case (none) { p.fatal("unknown syntax expander: '" + extname + "'"); }
@@ -1509,7 +1469,7 @@ fn parse_stmt(&parser p) -> @ast::stmt {
 }
 
 fn parse_crate_stmt(&parser p) -> @ast::stmt {
-    auto cdir = parse_crate_directive(p, ~[]);
+    auto cdir = parse_crate_directive(p, []);
     ret @spanned(cdir.span.lo, cdir.span.hi,
                  ast::stmt_crate_directive(@cdir));
 }
@@ -1527,7 +1487,7 @@ fn parse_source_stmt(&parser p) -> @ast::stmt {
         auto item_attrs;
         alt (parse_outer_attrs_or_ext(p)) {
             case (none) {
-                item_attrs = ~[];
+                item_attrs = [];
             }
             case (some(left(?attrs))) {
                 item_attrs = attrs;
@@ -1541,7 +1501,7 @@ fn parse_source_stmt(&parser p) -> @ast::stmt {
         auto maybe_item = parse_item(p, item_attrs);
 
         // If we have attributes then we should have an item
-        if (ivec::len(item_attrs) > 0u) {
+        if (vec::len(item_attrs) > 0u) {
             alt (maybe_item) {
                 case (got_item(_)) { /* fallthrough */ }
                 case (_) {
@@ -1747,7 +1707,7 @@ fn parse_fn_header(&parser p) -> tup(ast::ident, vec[ast::ty_param]) {
 }
 
 fn mk_item(&parser p, uint lo, uint hi, &ast::ident ident, &ast::item_ node,
-           &ast::attribute[] attrs) -> @ast::item {
+           &vec[ast::attribute] attrs) -> @ast::item {
     ret @rec(ident=ident,
              attrs=attrs,
              id=p.get_id(),
@@ -1756,7 +1716,7 @@ fn mk_item(&parser p, uint lo, uint hi, &ast::ident ident, &ast::item_ node,
 }
 
 fn parse_item_fn_or_iter(&parser p, ast::purity purity, ast::proto proto,
-                         &ast::attribute[] attrs) -> @ast::item {
+                         vec[ast::attribute] attrs) -> @ast::item {
     auto lo = p.get_last_lo_pos();
     auto t = parse_fn_header(p);
     auto f = parse_fn(p, proto, purity);
@@ -1807,7 +1767,7 @@ fn parse_dtor(&parser p) -> @ast::method {
     ret @spanned(lo, f.body.span.hi, m);
 }
 
-fn parse_item_obj(&parser p, ast::layer lyr, &ast::attribute[] attrs) ->
+fn parse_item_obj(&parser p, ast::layer lyr, vec[ast::attribute] attrs) ->
    @ast::item {
     auto lo = p.get_last_lo_pos();
     auto ident = parse_value_ident(p);
@@ -1830,7 +1790,7 @@ fn parse_item_obj(&parser p, ast::layer lyr, &ast::attribute[] attrs) ->
                                                 p.get_id()), attrs);
 }
 
-fn parse_item_res(&parser p, ast::layer lyr, &ast::attribute[] attrs) ->
+fn parse_item_res(&parser p, ast::layer lyr, vec[ast::attribute] attrs) ->
    @ast::item {
     auto lo = p.get_last_lo_pos();
     auto ident = parse_value_ident(p);
@@ -1852,8 +1812,8 @@ fn parse_item_res(&parser p, ast::layer lyr, &ast::attribute[] attrs) ->
 }
 
 fn parse_mod_items(&parser p, token::token term,
-                   &ast::attribute[] first_item_attrs) -> ast::_mod {
-    auto view_items = if (ivec::len(first_item_attrs) == 0u) {
+                   vec[ast::attribute] first_item_attrs) -> ast::_mod {
+    auto view_items = if (vec::len(first_item_attrs) == 0u) {
         parse_view(p)
     } else {
         // Shouldn't be any view items since we've already parsed an item attr
@@ -1863,7 +1823,7 @@ fn parse_mod_items(&parser p, token::token term,
     auto initial_attrs = first_item_attrs;
     while (p.peek() != term) {
         auto attrs = initial_attrs + parse_outer_attributes(p);
-        initial_attrs = ~[];
+        initial_attrs = [];
         alt (parse_item(p, attrs)) {
             case (got_item(?i)) { vec::push(items, i); }
             case (_) {
@@ -1875,7 +1835,7 @@ fn parse_mod_items(&parser p, token::token term,
     ret rec(view_items=view_items, items=items);
 }
 
-fn parse_item_const(&parser p, &ast::attribute[] attrs) -> @ast::item {
+fn parse_item_const(&parser p, vec[ast::attribute] attrs) -> @ast::item {
     auto lo = p.get_last_lo_pos();
     auto ty = parse_ty(p);
     auto id = parse_value_ident(p);
@@ -1886,20 +1846,21 @@ fn parse_item_const(&parser p, &ast::attribute[] attrs) -> @ast::item {
     ret mk_item(p, lo, hi, id, ast::item_const(ty, e), attrs);
 }
 
-fn parse_item_mod(&parser p, &ast::attribute[] attrs) -> @ast::item {
+fn parse_item_mod(&parser p, vec[ast::attribute] attrs) -> @ast::item {
     auto lo = p.get_last_lo_pos();
     auto id = parse_ident(p);
     expect(p, token::LBRACE);
     auto inner_attrs = parse_inner_attrs_and_next(p);
     auto first_item_outer_attrs = inner_attrs._1;
-    auto m = parse_mod_items(p, token::RBRACE, first_item_outer_attrs);
+    auto m = parse_mod_items(p, token::RBRACE,
+                             first_item_outer_attrs);
     auto hi = p.get_hi_pos();
     expect(p, token::RBRACE);
     ret mk_item(p, lo, hi, id, ast::item_mod(m), attrs + inner_attrs._0);
 }
 
-fn parse_item_native_type(&parser p, &ast::attribute[] attrs)
-        -> @ast::native_item {
+fn parse_item_native_type(&parser p,
+                          &vec[ast::attribute] attrs) -> @ast::native_item {
     auto t = parse_type_decl(p);
     auto hi = p.get_hi_pos();
     expect(p, token::SEMI);
@@ -1910,8 +1871,8 @@ fn parse_item_native_type(&parser p, &ast::attribute[] attrs)
              span=rec(lo=t._0, hi=hi));
 }
 
-fn parse_item_native_fn(&parser p, &ast::attribute[] attrs)
-        -> @ast::native_item {
+fn parse_item_native_fn(&parser p,
+                        &vec[ast::attribute] attrs) -> @ast::native_item {
     auto lo = p.get_last_lo_pos();
     auto t = parse_fn_header(p);
     auto decl = parse_fn_decl(p, ast::impure_fn);
@@ -1929,8 +1890,8 @@ fn parse_item_native_fn(&parser p, &ast::attribute[] attrs)
              span=rec(lo=lo, hi=hi));
 }
 
-fn parse_native_item(&parser p, &ast::attribute[] attrs)
-        -> @ast::native_item {
+fn parse_native_item(&parser p,
+                     &vec[ast::attribute] attrs) -> @ast::native_item {
     parse_layer(p);
     if (eat_word(p, "type")) {
         ret parse_item_native_type(p, attrs);
@@ -1940,9 +1901,9 @@ fn parse_native_item(&parser p, &ast::attribute[] attrs)
 }
 
 fn parse_native_mod_items(&parser p, &str native_name, ast::native_abi abi,
-                          &ast::attribute[] first_item_attrs)
-        -> ast::native_mod {
-    auto view_items = if (ivec::len(first_item_attrs) == 0u) {
+                          &vec[ast::attribute] first_item_attrs) ->
+   ast::native_mod {
+    auto view_items = if (vec::len(first_item_attrs) == 0u) {
         parse_native_view(p)
     } else {
         // Shouldn't be any view items since we've already parsed an item attr
@@ -1952,7 +1913,7 @@ fn parse_native_mod_items(&parser p, &str native_name, ast::native_abi abi,
     auto initial_attrs = first_item_attrs;
     while (p.peek() != token::RBRACE) {
         auto attrs = initial_attrs + parse_outer_attributes(p);
-        initial_attrs = ~[];
+        initial_attrs = [];
         items += [parse_native_item(p, attrs)];
     }
     ret rec(native_name=native_name,
@@ -1961,7 +1922,7 @@ fn parse_native_mod_items(&parser p, &str native_name, ast::native_abi abi,
             items=items);
 }
 
-fn parse_item_native_mod(&parser p, &ast::attribute[] attrs) -> @ast::item {
+fn parse_item_native_mod(&parser p, vec[ast::attribute] attrs) -> @ast::item {
     auto lo = p.get_last_lo_pos();
     auto abi = ast::native_abi_cdecl;
     if (!is_word(p, "mod")) {
@@ -2001,7 +1962,7 @@ fn parse_type_decl(&parser p) -> tup(uint, ast::ident) {
     ret tup(lo, id);
 }
 
-fn parse_item_type(&parser p, &ast::attribute[] attrs) -> @ast::item {
+fn parse_item_type(&parser p, vec[ast::attribute] attrs) -> @ast::item {
     auto t = parse_type_decl(p);
     auto tps = parse_ty_params(p);
     expect(p, token::EQ);
@@ -2011,7 +1972,7 @@ fn parse_item_type(&parser p, &ast::attribute[] attrs) -> @ast::item {
     ret mk_item(p, t._0, hi, t._1, ast::item_ty(ty, tps), attrs);
 }
 
-fn parse_item_tag(&parser p, &ast::attribute[] attrs) -> @ast::item {
+fn parse_item_tag(&parser p, vec[ast::attribute] attrs) -> @ast::item {
     auto lo = p.get_last_lo_pos();
     auto id = parse_ident(p);
     auto ty_params = parse_ty_params(p);
@@ -2090,7 +2051,7 @@ fn parse_auth(&parser p) -> ast::_auth {
 
 tag parsed_item { got_item(@ast::item); no_item; fn_no_item; }
 
-fn parse_item(&parser p, &ast::attribute[] attrs) -> parsed_item {
+fn parse_item(&parser p, vec[ast::attribute] attrs) -> parsed_item {
     if (eat_word(p, "const")) {
         ret got_item(parse_item_const(p, attrs));
     } else if (eat_word(p, "fn")) {
@@ -2124,7 +2085,8 @@ fn parse_item(&parser p, &ast::attribute[] attrs) -> parsed_item {
 
 // A type to distingush between the parsing of item attributes or syntax
 // extensions, which both begin with token.POUND
-type attr_or_ext = option::t[either::t[ast::attribute[], @ast::expr]];
+type attr_or_ext = option::t[either::t[vec[ast::attribute],
+                                       @ast::expr]];
 
 fn parse_outer_attrs_or_ext(&parser p) -> attr_or_ext {
     if (p.peek() == token::POUND) {
@@ -2132,7 +2094,7 @@ fn parse_outer_attrs_or_ext(&parser p) -> attr_or_ext {
         p.bump();
         if (p.peek() == token::LBRACKET) {
             auto first_attr = parse_attribute_naked(p, ast::attr_outer, lo);
-            ret some(left(~[first_attr] + parse_outer_attributes(p)));
+            ret some(left([first_attr] + parse_outer_attributes(p)));
         } else {
             ret some(right(parse_syntax_ext_naked(p, lo)));
         }
@@ -2142,10 +2104,10 @@ fn parse_outer_attrs_or_ext(&parser p) -> attr_or_ext {
 }
 
 // Parse attributes that appear before an item
-fn parse_outer_attributes(&parser p) -> ast::attribute[] {
-    let ast::attribute[] attrs = ~[];
+fn parse_outer_attributes(&parser p) -> vec[ast::attribute] {
+    let vec[ast::attribute] attrs = [];
     while (p.peek() == token::POUND) {
-        attrs += ~[parse_attribute(p, ast::attr_outer)];
+        attrs += [parse_attribute(p, ast::attr_outer)];
     }
     ret attrs;
 }
@@ -2171,22 +2133,22 @@ fn parse_attribute_naked(&parser p, ast::attr_style style,
 // next item (since we can't know whether the attribute is an inner attribute
 // of the containing item or an outer attribute of the first contained item
 // until we see the semi).
-fn parse_inner_attrs_and_next(&parser p) -> tup(ast::attribute[],
-                                                ast::attribute[]) {
-    let ast::attribute[] inner_attrs = ~[];
-    let ast::attribute[] next_outer_attrs = ~[];
+fn parse_inner_attrs_and_next(&parser p) -> tup(vec[ast::attribute],
+                                                vec[ast::attribute]) {
+    let vec[ast::attribute] inner_attrs = [];
+    let vec[ast::attribute] next_outer_attrs = [];
     while (p.peek() == token::POUND) {
         auto attr = parse_attribute(p, ast::attr_inner);
         if (p.peek() == token::SEMI) {
             p.bump();
-            inner_attrs += ~[attr];
+            inner_attrs += [attr];
         } else {
             // It's not really an inner attribute
             auto outer_attr = spanned(attr.span.lo,
                                       attr.span.hi,
                                       rec(style=ast::attr_outer,
                                           value=attr.node.value));
-            next_outer_attrs += ~[outer_attr];
+            next_outer_attrs += [outer_attr];
             break;
         }
     }
@@ -2215,15 +2177,15 @@ fn parse_meta_item(&parser p) -> @ast::meta_item {
     }
 }
 
-fn parse_meta_seq(&parser p) -> (@ast::meta_item)[] {
-    ret parse_seq_ivec(token::LPAREN, token::RPAREN, some(token::COMMA),
-                       parse_meta_item, p).node;
+fn parse_meta_seq(&parser p) -> vec[@ast::meta_item] {
+    ret parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
+                  parse_meta_item, p).node;
 }
 
-fn parse_optional_meta(&parser p) -> (@ast::meta_item)[] {
+fn parse_optional_meta(&parser p) -> vec[@ast::meta_item] {
     alt (p.peek()) {
         case (token::LPAREN) { ret parse_meta_seq(p); }
-        case (_) { ret ~[]; }
+        case (_) { let vec[@ast::meta_item] v = []; ret v; }
     }
 }
 
@@ -2233,7 +2195,8 @@ fn parse_use(&parser p) -> @ast::view_item {
     auto metadata = parse_optional_meta(p);
     auto hi = p.get_hi_pos();
     expect(p, token::SEMI);
-    auto use_decl = ast::view_item_use(ident, metadata, p.get_id());
+    auto use_decl =
+        ast::view_item_use(ident, metadata, p.get_id());
     ret @spanned(lo, hi, use_decl);
 }
 
@@ -2366,7 +2329,8 @@ fn parse_crate_from_source_file(&str input, &ast::crate_cfg cfg,
     auto first_item_outer_attrs = crate_attrs._1;
     auto m = parse_mod_items(p, token::EOF,
                              first_item_outer_attrs);
-    ret @spanned(lo, p.get_lo_pos(), rec(directives=~[],
+    let vec[@ast::crate_directive] cdirs = [];
+    ret @spanned(lo, p.get_lo_pos(), rec(directives=cdirs,
                                          module=m,
                                          attrs=crate_attrs._0,
                                          config=p.get_cfg()));
@@ -2387,13 +2351,14 @@ fn parse_str(&parser p) -> ast::ident {
 // Each crate file is a sequence of directives.
 //
 // Each directive imperatively extends its environment with 0 or more items.
-fn parse_crate_directive(&parser p, &ast::attribute[] first_outer_attr)
+fn parse_crate_directive(&parser p, vec[ast::attribute] first_outer_attr)
     -> ast::crate_directive {
 
     // Collect the next attributes
-    auto outer_attrs = first_outer_attr + parse_outer_attributes(p);
+    auto outer_attrs = first_outer_attr
+        + parse_outer_attributes(p);
     // In a crate file outer attributes are only going to apply to mods
-    auto expect_mod = ivec::len(outer_attrs) > 0u;
+    auto expect_mod = vec::len(outer_attrs) > 0u;
 
     auto lo = p.get_lo_pos();
     if (expect_mod || is_word(p, "mod")) {
@@ -2448,20 +2413,20 @@ fn parse_crate_directive(&parser p, &ast::attribute[] first_outer_attr)
 }
 
 fn parse_crate_directives(&parser p, token::token term,
-                          &ast::attribute[] first_outer_attr)
-        -> (@ast::crate_directive)[] {
+                          vec[ast::attribute] first_outer_attr) ->
+   vec[@ast::crate_directive] {
 
     // This is pretty ugly. If we have an outer attribute then we can't accept
     // seeing the terminator next, so if we do see it then fail the same way
     // parse_crate_directive would
-    if (ivec::len(first_outer_attr) > 0u && p.peek() == term) {
+    if (vec::len(first_outer_attr) > 0u && p.peek() == term) {
         expect_word(p, "mod");
     }
 
-    let (@ast::crate_directive)[] cdirs = ~[];
+    let vec[@ast::crate_directive] cdirs = [];
     while (p.peek() != term) {
         auto cdir = @parse_crate_directive(p, first_outer_attr);
-        cdirs += ~[cdir];
+        vec::push(cdirs, cdir);
     }
     ret cdirs;
 }
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index b03262f58e8..86ae4cbd295 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1,10 +1,9 @@
 
-import std::ivec;
-import std::int;
-import std::io;
-import std::str;
 import std::uint;
+import std::int;
 import std::vec;
+import std::str;
+import std::io;
 import std::option;
 import parse::lexer;
 import syntax::codemap::codemap;
@@ -207,17 +206,6 @@ fn commasep[IN](&ps s, breaks b, vec[IN] elts, fn(&ps, &IN)  op) {
     end(s);
 }
 
-fn commasep_ivec[IN](&ps s, breaks b, &IN[] elts, fn(&ps, &IN)  op) {
-    box(s, 0u, b);
-    auto first = true;
-    for (IN elt in elts) {
-        if (first) { first = false; } else { word_space(s, ","); }
-        op(s, elt);
-    }
-    end(s);
-}
-
-
 fn commasep_cmnt[IN](&ps s, breaks b, vec[IN] elts, fn(&ps, &IN)  op,
                      fn(&IN) -> codemap::span  get_span) {
     box(s, 0u, b);
@@ -242,7 +230,7 @@ fn commasep_exprs(&ps s, breaks b, vec[@ast::expr] exprs) {
     commasep_cmnt(s, b, exprs, print_expr, expr_span);
 }
 
-fn print_mod(&ps s, ast::_mod _mod, &ast::attribute[] attrs) {
+fn print_mod(&ps s, ast::_mod _mod, &vec[ast::attribute] attrs) {
     print_inner_attributes(s, attrs);
     for (@ast::view_item vitem in _mod.view_items) {
         print_view_item(s, vitem);
@@ -533,7 +521,7 @@ fn print_item(&ps s, &@ast::item item) {
     s.ann.post(ann_node);
 }
 
-fn print_outer_attributes(&ps s, &ast::attribute[] attrs) {
+fn print_outer_attributes(&ps s, vec[ast::attribute] attrs) {
     auto count = 0;
     for (ast::attribute attr in attrs) {
         alt (attr.node.style) {
@@ -544,7 +532,7 @@ fn print_outer_attributes(&ps s, &ast::attribute[] attrs) {
     if (count > 0) { hardbreak_if_not_bol(s); }
 }
 
-fn print_inner_attributes(&ps s, &ast::attribute[] attrs) {
+fn print_inner_attributes(&ps s, vec[ast::attribute] attrs) {
     auto count = 0;
     for (ast::attribute attr in attrs) {
         alt (attr.node.style) {
@@ -1025,9 +1013,9 @@ fn print_path(&ps s, &ast::path path) {
         if (first) { first = false; } else { word(s.s, "::"); }
         word(s.s, id);
     }
-    if (ivec::len(path.node.types) > 0u) {
+    if (vec::len(path.node.types) > 0u) {
         word(s.s, "[");
-        commasep_ivec(s, inconsistent, path.node.types, print_boxed_type);
+        commasep(s, inconsistent, path.node.types, print_boxed_type);
         word(s.s, "]");
     }
 }
@@ -1118,7 +1106,7 @@ fn print_meta_item(&ps s, &@ast::meta_item item) {
         case (ast::meta_list(?name, ?items)) {
             word(s.s, name);
             popen(s);
-            commasep_ivec(s, consistent, items, print_meta_item);
+            commasep(s, consistent, items, print_meta_item);
             pclose(s);
         }
     }
@@ -1132,9 +1120,9 @@ fn print_view_item(&ps s, &@ast::view_item item) {
         case (ast::view_item_use(?id, ?mta, _)) {
             head(s, "use");
             word(s.s, id);
-            if (ivec::len(mta) > 0u) {
+            if (vec::len(mta) > 0u) {
                 popen(s);
-                commasep_ivec(s, consistent, mta, print_meta_item);
+                commasep(s, consistent, mta, print_meta_item);
                 pclose(s);
             }
         }
@@ -1433,7 +1421,7 @@ fn next_comment(&ps s) -> option::t[lexer::cmnt] {
 
 
 fn constr_args_to_str[T](fn(&T) -> str  f,
-                         &(@ast::constr_arg_general[T])[] args) -> str {
+                         &vec[@ast::constr_arg_general[T]] args) -> str {
     auto comma = false;
     auto s = "(";
     for (@ast::constr_arg_general[T] a in args) {
@@ -1459,13 +1447,8 @@ fn constr_arg_to_str[T](fn(&T) -> str  f, &ast::constr_arg_general_[T] c) ->
 fn uint_to_str(&uint i) -> str { ret uint::str(i); }
 
 fn ast_constr_to_str(&@ast::constr c) -> str {
-    // TODO: Remove this vec->ivec conversion.
-    auto cag_ivec = ~[];
-    for (@ast::constr_arg_general[uint] cag in c.node.args) {
-        cag_ivec += ~[cag];
-    }
     ret ast::path_to_str(c.node.path) +
-            constr_args_to_str(uint_to_str, cag_ivec);
+            constr_args_to_str(uint_to_str, c.node.args);
 }
 
 fn ast_constrs_str(&vec[@ast::constr] constrs) -> str {
diff --git a/src/comp/syntax/util/interner.rs b/src/comp/syntax/util/interner.rs
index 9717e30d6e6..e096b953a89 100644
--- a/src/comp/syntax/util/interner.rs
+++ b/src/comp/syntax/util/interner.rs
@@ -1,7 +1,7 @@
 // An "interner" is a data structure that associates values with uint tags and
 // allows bidirectional lookup; i.e. given a value, one can easily find the
 // type, and vice versa.
-import std::ivec;
+import std::vec;
 import std::map;
 import std::map::hashmap;
 import std::map::hashfn;
@@ -12,24 +12,24 @@ import std::option::some;
 
 type interner[T] =
     rec(hashmap[T, uint] map,
-        mutable T[] vect,
+        mutable vec[T] vect,
         hashfn[T] hasher,
         eqfn[T] eqer);
 
 fn mk[T](hashfn[T] hasher, eqfn[T] eqer) -> interner[T] {
     auto m = map::mk_hashmap[T, uint](hasher, eqer);
-    ret rec(map=m, mutable vect=~[], hasher=hasher, eqer=eqer);
+    let vec[T] vect = [];
+    ret rec(map=m, mutable vect=vect, hasher=hasher, eqer=eqer);
 }
 fn intern[T](&interner[T] itr, &T val) -> uint {
     alt (itr.map.find(val)) {
         case (some(?idx)) { ret idx; }
         case (none) {
-            auto new_idx = ivec::len[T](itr.vect);
+            auto new_idx = vec::len[T](itr.vect);
             itr.map.insert(val, new_idx);
-            itr.vect += ~[val];
+            itr.vect += [val];
             ret new_idx;
         }
     }
 }
 fn get[T](&interner[T] itr, uint idx) -> T { ret itr.vect.(idx); }
-