about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/asm.rs12
-rw-r--r--src/libsyntax/ext/base.rs34
-rw-r--r--src/libsyntax/ext/build.rs257
-rw-r--r--src/libsyntax/ext/bytes.rs3
-rw-r--r--src/libsyntax/ext/cfg.rs11
-rw-r--r--src/libsyntax/ext/concat_idents.rs4
-rw-r--r--src/libsyntax/ext/deriving/clone.rs30
-rw-r--r--src/libsyntax/ext/deriving/cmp/eq.rs16
-rw-r--r--src/libsyntax/ext/deriving/cmp/ord.rs16
-rw-r--r--src/libsyntax/ext/deriving/cmp/totaleq.rs16
-rw-r--r--src/libsyntax/ext/deriving/cmp/totalord.rs22
-rw-r--r--src/libsyntax/ext/deriving/decodable.rs53
-rw-r--r--src/libsyntax/ext/deriving/default.rs21
-rw-r--r--src/libsyntax/ext/deriving/encodable.rs53
-rw-r--r--src/libsyntax/ext/deriving/generic.rs148
-rw-r--r--src/libsyntax/ext/deriving/hash.rs20
-rw-r--r--src/libsyntax/ext/deriving/primitive.rs37
-rw-r--r--src/libsyntax/ext/deriving/rand.rs40
-rw-r--r--src/libsyntax/ext/deriving/show.rs29
-rw-r--r--src/libsyntax/ext/deriving/ty.rs41
-rw-r--r--src/libsyntax/ext/deriving/zero.rs24
-rw-r--r--src/libsyntax/ext/env.rs33
-rw-r--r--src/libsyntax/ext/expand.rs167
-rw-r--r--src/libsyntax/ext/format.rs192
-rw-r--r--src/libsyntax/ext/log_syntax.rs3
-rw-r--r--src/libsyntax/ext/quote.rs118
-rw-r--r--src/libsyntax/ext/registrar.rs9
-rw-r--r--src/libsyntax/ext/source_util.rs1
-rw-r--r--src/libsyntax/ext/trace_macros.rs2
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs63
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs43
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs20
32 files changed, 825 insertions, 713 deletions
diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs
index 1bf82573c49..6080613460d 100644
--- a/src/libsyntax/ext/asm.rs
+++ b/src/libsyntax/ext/asm.rs
@@ -20,6 +20,8 @@ use parse;
 use parse::token::InternedString;
 use parse::token;
 
+use std::vec_ng::Vec;
+
 enum State {
     Asm,
     Outputs,
@@ -42,12 +44,14 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
                -> base::MacResult {
     let mut p = parse::new_parser_from_tts(cx.parse_sess(),
                                            cx.cfg(),
-                                           tts.to_owned());
+                                           tts.iter()
+                                              .map(|x| (*x).clone())
+                                              .collect());
 
     let mut asm = InternedString::new("");
     let mut asm_str_style = None;
-    let mut outputs = ~[];
-    let mut inputs = ~[];
+    let mut outputs = Vec::new();
+    let mut inputs = Vec::new();
     let mut cons = ~"";
     let mut volatile = false;
     let mut alignstack = false;
@@ -119,7 +123,7 @@ pub fn expand_asm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
                 }
             }
             Clobbers => {
-                let mut clobs = ~[];
+                let mut clobs = Vec::new();
                 while p.token != token::EOF &&
                       p.token != token::COLON &&
                       p.token != token::MOD_SEP {
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 0636d19163e..e9fe21eded6 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -20,6 +20,7 @@ use parse::token::{InternedString, intern, str_to_ident};
 use util::small_vector::SmallVector;
 
 use collections::HashMap;
+use std::vec_ng::Vec;
 
 // new-style macro! tt code:
 //
@@ -74,7 +75,7 @@ pub trait IdentMacroExpander {
               cx: &mut ExtCtxt,
               sp: Span,
               ident: ast::Ident,
-              token_tree: ~[ast::TokenTree])
+              token_tree: Vec<ast::TokenTree> )
               -> MacResult;
 }
 
@@ -83,14 +84,14 @@ impl IdentMacroExpander for BasicIdentMacroExpander {
               cx: &mut ExtCtxt,
               sp: Span,
               ident: ast::Ident,
-              token_tree: ~[ast::TokenTree])
+              token_tree: Vec<ast::TokenTree> )
               -> MacResult {
         (self.expander)(cx, sp, ident, token_tree)
     }
 }
 
 pub type IdentMacroExpanderFn =
-    fn(&mut ExtCtxt, Span, ast::Ident, ~[ast::TokenTree]) -> MacResult;
+    fn(&mut ExtCtxt, Span, ast::Ident, Vec<ast::TokenTree> ) -> MacResult;
 
 pub type MacroCrateRegistrationFun =
     fn(|ast::Name, SyntaxExtension|);
@@ -154,13 +155,13 @@ impl BlockInfo {
     pub fn new() -> BlockInfo {
         BlockInfo {
             macros_escape: false,
-            pending_renames: ~[],
+            pending_renames: Vec::new(),
         }
     }
 }
 
 // a list of ident->name renamings
-pub type RenameList = ~[(ast::Ident,Name)];
+pub type RenameList = Vec<(ast::Ident,Name)> ;
 
 // The base map of methods for expanding syntax extension
 // AST nodes into full ASTs
@@ -271,7 +272,7 @@ pub struct MacroCrate {
 
 pub trait CrateLoader {
     fn load_crate(&mut self, krate: &ast::ViewItem) -> MacroCrate;
-    fn get_exported_macros(&mut self, crate_num: ast::CrateNum) -> ~[~str];
+    fn get_exported_macros(&mut self, crate_num: ast::CrateNum) -> Vec<~str> ;
     fn get_registrar_symbol(&mut self, crate_num: ast::CrateNum) -> Option<~str>;
 }
 
@@ -284,7 +285,7 @@ pub struct ExtCtxt<'a> {
     backtrace: Option<@ExpnInfo>,
     loader: &'a mut CrateLoader,
 
-    mod_path: ~[ast::Ident],
+    mod_path: Vec<ast::Ident> ,
     trace_mac: bool
 }
 
@@ -296,7 +297,7 @@ impl<'a> ExtCtxt<'a> {
             cfg: cfg,
             backtrace: None,
             loader: loader,
-            mod_path: ~[],
+            mod_path: Vec::new(),
             trace_mac: false
         }
     }
@@ -329,7 +330,7 @@ impl<'a> ExtCtxt<'a> {
     pub fn backtrace(&self) -> Option<@ExpnInfo> { self.backtrace }
     pub fn mod_push(&mut self, i: ast::Ident) { self.mod_path.push(i); }
     pub fn mod_pop(&mut self) { self.mod_path.pop().unwrap(); }
-    pub fn mod_path(&self) -> ~[ast::Ident] { self.mod_path.clone() }
+    pub fn mod_path(&self) -> Vec<ast::Ident> { self.mod_path.clone() }
     pub fn bt_push(&mut self, ei: codemap::ExpnInfo) {
         match ei {
             ExpnInfo {call_site: cs, callee: ref callee} => {
@@ -458,11 +459,13 @@ pub fn get_single_str_from_tts(cx: &ExtCtxt,
 /// parsing error, emit a non-fatal error and return None.
 pub fn get_exprs_from_tts(cx: &ExtCtxt,
                           sp: Span,
-                          tts: &[ast::TokenTree]) -> Option<~[@ast::Expr]> {
+                          tts: &[ast::TokenTree]) -> Option<Vec<@ast::Expr> > {
     let mut p = parse::new_parser_from_tts(cx.parse_sess(),
                                            cx.cfg(),
-                                           tts.to_owned());
-    let mut es = ~[];
+                                           tts.iter()
+                                              .map(|x| (*x).clone())
+                                              .collect());
+    let mut es = Vec::new();
     while p.token != token::EOF {
         if es.len() != 0 && !p.eat(&token::COMMA) {
             cx.span_err(sp, "expected token: `,`");
@@ -507,12 +510,12 @@ impl Drop for MapChainFrame {
 
 // Only generic to make it easy to test
 pub struct SyntaxEnv {
-    priv chain: ~[MapChainFrame],
+    priv chain: Vec<MapChainFrame> ,
 }
 
 impl SyntaxEnv {
     pub fn new() -> SyntaxEnv {
-        let mut map = SyntaxEnv { chain: ~[] };
+        let mut map = SyntaxEnv { chain: Vec::new() };
         map.push_frame();
         map
     }
@@ -553,6 +556,7 @@ impl SyntaxEnv {
     }
 
     pub fn info<'a>(&'a mut self) -> &'a mut BlockInfo {
-        &mut self.chain[self.chain.len()-1].info
+        let last_chain_index = self.chain.len() - 1;
+        &mut self.chain.get_mut(last_chain_index).info
     }
 }
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index 1ddd579a2f1..34625923ea1 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -21,6 +21,8 @@ use opt_vec::OptVec;
 use parse::token::special_idents;
 use parse::token;
 
+use std::vec_ng::Vec;
+
 pub struct Field {
     ident: ast::Ident,
     ex: @ast::Expr
@@ -34,14 +36,14 @@ mod syntax {
 
 pub trait AstBuilder {
     // paths
-    fn path(&self, span: Span, strs: ~[ast::Ident]) -> ast::Path;
+    fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path;
     fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path;
-    fn path_global(&self, span: Span, strs: ~[ast::Ident]) -> ast::Path;
+    fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path;
     fn path_all(&self, sp: Span,
                 global: bool,
-                idents: ~[ast::Ident],
+                idents: Vec<ast::Ident> ,
                 lifetimes: OptVec<ast::Lifetime>,
-                types: ~[P<ast::Ty>])
+                types: Vec<P<ast::Ty>> )
         -> ast::Path;
 
     // types
@@ -61,8 +63,8 @@ pub trait AstBuilder {
     fn ty_infer(&self, sp: Span) -> P<ast::Ty>;
     fn ty_nil(&self) -> P<ast::Ty>;
 
-    fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>];
-    fn ty_vars_global(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>];
+    fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> Vec<P<ast::Ty>> ;
+    fn ty_vars_global(&self, ty_params: &OptVec<ast::TyParam>) -> Vec<P<ast::Ty>> ;
     fn ty_field_imm(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> ast::TypeField;
     fn strip_bounds(&self, bounds: &Generics) -> Generics;
 
@@ -87,11 +89,11 @@ pub trait AstBuilder {
                       -> @ast::Stmt;
 
     // blocks
-    fn block(&self, span: Span, stmts: ~[@ast::Stmt], expr: Option<@ast::Expr>) -> P<ast::Block>;
+    fn block(&self, span: Span, stmts: Vec<@ast::Stmt> , expr: Option<@ast::Expr>) -> P<ast::Block>;
     fn block_expr(&self, expr: @ast::Expr) -> P<ast::Block>;
     fn block_all(&self, span: Span,
-                 view_items: ~[ast::ViewItem],
-                 stmts: ~[@ast::Stmt],
+                 view_items: Vec<ast::ViewItem> ,
+                 stmts: Vec<@ast::Stmt> ,
                  expr: Option<@ast::Expr>) -> P<ast::Block>;
 
     // expressions
@@ -109,19 +111,19 @@ pub trait AstBuilder {
     fn expr_addr_of(&self, sp: Span, e: @ast::Expr) -> @ast::Expr;
     fn expr_mut_addr_of(&self, sp: Span, e: @ast::Expr) -> @ast::Expr;
     fn expr_field_access(&self, span: Span, expr: @ast::Expr, ident: ast::Ident) -> @ast::Expr;
-    fn expr_call(&self, span: Span, expr: @ast::Expr, args: ~[@ast::Expr]) -> @ast::Expr;
-    fn expr_call_ident(&self, span: Span, id: ast::Ident, args: ~[@ast::Expr]) -> @ast::Expr;
-    fn expr_call_global(&self, sp: Span, fn_path: ~[ast::Ident],
-                        args: ~[@ast::Expr]) -> @ast::Expr;
+    fn expr_call(&self, span: Span, expr: @ast::Expr, args: Vec<@ast::Expr> ) -> @ast::Expr;
+    fn expr_call_ident(&self, span: Span, id: ast::Ident, args: Vec<@ast::Expr> ) -> @ast::Expr;
+    fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident> ,
+                        args: Vec<@ast::Expr> ) -> @ast::Expr;
     fn expr_method_call(&self, span: Span,
                         expr: @ast::Expr, ident: ast::Ident,
-                        args: ~[@ast::Expr]) -> @ast::Expr;
+                        args: Vec<@ast::Expr> ) -> @ast::Expr;
     fn expr_block(&self, b: P<ast::Block>) -> @ast::Expr;
     fn expr_cast(&self, sp: Span, expr: @ast::Expr, ty: P<ast::Ty>) -> @ast::Expr;
 
     fn field_imm(&self, span: Span, name: Ident, e: @ast::Expr) -> ast::Field;
-    fn expr_struct(&self, span: Span, path: ast::Path, fields: ~[ast::Field]) -> @ast::Expr;
-    fn expr_struct_ident(&self, span: Span, id: ast::Ident, fields: ~[ast::Field]) -> @ast::Expr;
+    fn expr_struct(&self, span: Span, path: ast::Path, fields: Vec<ast::Field> ) -> @ast::Expr;
+    fn expr_struct_ident(&self, span: Span, id: ast::Ident, fields: Vec<ast::Field> ) -> @ast::Expr;
 
     fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> @ast::Expr;
 
@@ -131,9 +133,9 @@ pub trait AstBuilder {
     fn expr_bool(&self, sp: Span, value: bool) -> @ast::Expr;
 
     fn expr_vstore(&self, sp: Span, expr: @ast::Expr, vst: ast::ExprVstore) -> @ast::Expr;
-    fn expr_vec(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr;
-    fn expr_vec_uniq(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr;
-    fn expr_vec_slice(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr;
+    fn expr_vec(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr;
+    fn expr_vec_ng(&self, sp: Span) -> @ast::Expr;
+    fn expr_vec_slice(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr;
     fn expr_str(&self, sp: Span, s: InternedString) -> @ast::Expr;
     fn expr_str_uniq(&self, sp: Span, s: InternedString) -> @ast::Expr;
 
@@ -152,55 +154,55 @@ pub trait AstBuilder {
                               span: Span,
                               ident: ast::Ident,
                               bm: ast::BindingMode) -> @ast::Pat;
-    fn pat_enum(&self, span: Span, path: ast::Path, subpats: ~[@ast::Pat]) -> @ast::Pat;
+    fn pat_enum(&self, span: Span, path: ast::Path, subpats: Vec<@ast::Pat> ) -> @ast::Pat;
     fn pat_struct(&self, span: Span,
-                  path: ast::Path, field_pats: ~[ast::FieldPat]) -> @ast::Pat;
+                  path: ast::Path, field_pats: Vec<ast::FieldPat> ) -> @ast::Pat;
 
-    fn arm(&self, span: Span, pats: ~[@ast::Pat], expr: @ast::Expr) -> ast::Arm;
+    fn arm(&self, span: Span, pats: Vec<@ast::Pat> , expr: @ast::Expr) -> ast::Arm;
     fn arm_unreachable(&self, span: Span) -> ast::Arm;
 
-    fn expr_match(&self, span: Span, arg: @ast::Expr, arms: ~[ast::Arm]) -> @ast::Expr;
+    fn expr_match(&self, span: Span, arg: @ast::Expr, arms: Vec<ast::Arm> ) -> @ast::Expr;
     fn expr_if(&self, span: Span,
                cond: @ast::Expr, then: @ast::Expr, els: Option<@ast::Expr>) -> @ast::Expr;
 
     fn lambda_fn_decl(&self, span: Span,
                       fn_decl: P<ast::FnDecl>, blk: P<ast::Block>) -> @ast::Expr;
 
-    fn lambda(&self, span: Span, ids: ~[ast::Ident], blk: P<ast::Block>) -> @ast::Expr;
+    fn lambda(&self, span: Span, ids: Vec<ast::Ident> , blk: P<ast::Block>) -> @ast::Expr;
     fn lambda0(&self, span: Span, blk: P<ast::Block>) -> @ast::Expr;
     fn lambda1(&self, span: Span, blk: P<ast::Block>, ident: ast::Ident) -> @ast::Expr;
 
-    fn lambda_expr(&self, span: Span, ids: ~[ast::Ident], blk: @ast::Expr) -> @ast::Expr;
+    fn lambda_expr(&self, span: Span, ids: Vec<ast::Ident> , blk: @ast::Expr) -> @ast::Expr;
     fn lambda_expr_0(&self, span: Span, expr: @ast::Expr) -> @ast::Expr;
     fn lambda_expr_1(&self, span: Span, expr: @ast::Expr, ident: ast::Ident) -> @ast::Expr;
 
-    fn lambda_stmts(&self, span: Span, ids: ~[ast::Ident], blk: ~[@ast::Stmt]) -> @ast::Expr;
-    fn lambda_stmts_0(&self, span: Span, stmts: ~[@ast::Stmt]) -> @ast::Expr;
-    fn lambda_stmts_1(&self, span: Span, stmts: ~[@ast::Stmt], ident: ast::Ident) -> @ast::Expr;
+    fn lambda_stmts(&self, span: Span, ids: Vec<ast::Ident> , blk: Vec<@ast::Stmt> ) -> @ast::Expr;
+    fn lambda_stmts_0(&self, span: Span, stmts: Vec<@ast::Stmt> ) -> @ast::Expr;
+    fn lambda_stmts_1(&self, span: Span, stmts: Vec<@ast::Stmt> , ident: ast::Ident) -> @ast::Expr;
 
     // items
     fn item(&self, span: Span,
-            name: Ident, attrs: ~[ast::Attribute], node: ast::Item_) -> @ast::Item;
+            name: Ident, attrs: Vec<ast::Attribute> , node: ast::Item_) -> @ast::Item;
 
     fn arg(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> ast::Arg;
     // FIXME unused self
-    fn fn_decl(&self, inputs: ~[ast::Arg], output: P<ast::Ty>) -> P<ast::FnDecl>;
+    fn fn_decl(&self, inputs: Vec<ast::Arg> , output: P<ast::Ty>) -> P<ast::FnDecl>;
 
     fn item_fn_poly(&self,
                     span: Span,
                     name: Ident,
-                    inputs: ~[ast::Arg],
+                    inputs: Vec<ast::Arg> ,
                     output: P<ast::Ty>,
                     generics: Generics,
                     body: P<ast::Block>) -> @ast::Item;
     fn item_fn(&self,
                span: Span,
                name: Ident,
-               inputs: ~[ast::Arg],
+               inputs: Vec<ast::Arg> ,
                output: P<ast::Ty>,
                body: P<ast::Block>) -> @ast::Item;
 
-    fn variant(&self, span: Span, name: Ident, tys: ~[P<ast::Ty>]) -> ast::Variant;
+    fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant;
     fn item_enum_poly(&self,
                       span: Span,
                       name: Ident,
@@ -216,8 +218,8 @@ pub trait AstBuilder {
     fn item_struct(&self, span: Span, name: Ident, struct_def: ast::StructDef) -> @ast::Item;
 
     fn item_mod(&self, span: Span,
-                name: Ident, attrs: ~[ast::Attribute],
-                vi: ~[ast::ViewItem], items: ~[@ast::Item]) -> @ast::Item;
+                name: Ident, attrs: Vec<ast::Attribute> ,
+                vi: Vec<ast::ViewItem> , items: Vec<@ast::Item> ) -> @ast::Item;
 
     fn item_ty_poly(&self,
                     span: Span,
@@ -232,7 +234,7 @@ pub trait AstBuilder {
     fn meta_list(&self,
                  sp: Span,
                  name: InternedString,
-                 mis: ~[@ast::MetaItem])
+                 mis: Vec<@ast::MetaItem> )
                  -> @ast::MetaItem;
     fn meta_name_value(&self,
                        sp: Span,
@@ -241,35 +243,35 @@ pub trait AstBuilder {
                        -> @ast::MetaItem;
 
     fn view_use(&self, sp: Span,
-                vis: ast::Visibility, vp: ~[@ast::ViewPath]) -> ast::ViewItem;
+                vis: ast::Visibility, vp: Vec<@ast::ViewPath> ) -> ast::ViewItem;
     fn view_use_simple(&self, sp: Span, vis: ast::Visibility, path: ast::Path) -> ast::ViewItem;
     fn view_use_simple_(&self, sp: Span, vis: ast::Visibility,
                         ident: ast::Ident, path: ast::Path) -> ast::ViewItem;
     fn view_use_list(&self, sp: Span, vis: ast::Visibility,
-                     path: ~[ast::Ident], imports: &[ast::Ident]) -> ast::ViewItem;
+                     path: Vec<ast::Ident> , imports: &[ast::Ident]) -> ast::ViewItem;
     fn view_use_glob(&self, sp: Span,
-                     vis: ast::Visibility, path: ~[ast::Ident]) -> ast::ViewItem;
+                     vis: ast::Visibility, path: Vec<ast::Ident> ) -> ast::ViewItem;
 }
 
 impl<'a> AstBuilder for ExtCtxt<'a> {
-    fn path(&self, span: Span, strs: ~[ast::Ident]) -> ast::Path {
-        self.path_all(span, false, strs, opt_vec::Empty, ~[])
+    fn path(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
+        self.path_all(span, false, strs, opt_vec::Empty, Vec::new())
     }
     fn path_ident(&self, span: Span, id: ast::Ident) -> ast::Path {
-        self.path(span, ~[id])
+        self.path(span, vec!(id))
     }
-    fn path_global(&self, span: Span, strs: ~[ast::Ident]) -> ast::Path {
-        self.path_all(span, true, strs, opt_vec::Empty, ~[])
+    fn path_global(&self, span: Span, strs: Vec<ast::Ident> ) -> ast::Path {
+        self.path_all(span, true, strs, opt_vec::Empty, Vec::new())
     }
     fn path_all(&self,
                 sp: Span,
                 global: bool,
-                mut idents: ~[ast::Ident],
+                mut idents: Vec<ast::Ident> ,
                 lifetimes: OptVec<ast::Lifetime>,
-                types: ~[P<ast::Ty>])
+                types: Vec<P<ast::Ty>> )
                 -> ast::Path {
         let last_identifier = idents.pop().unwrap();
-        let mut segments: ~[ast::PathSegment] = idents.move_iter()
+        let mut segments: Vec<ast::PathSegment> = idents.move_iter()
                                                       .map(|ident| {
             ast::PathSegment {
                 identifier: ident,
@@ -335,13 +337,13 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         self.ty_path(
             self.path_all(DUMMY_SP,
                           true,
-                          ~[
+                          vec!(
                               self.ident_of("std"),
                               self.ident_of("option"),
                               self.ident_of("Option")
-                          ],
+                          ),
                           opt_vec::Empty,
-                          ~[ ty ]), None)
+                          vec!( ty )), None)
     }
 
     fn ty_field_imm(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> ast::TypeField {
@@ -379,15 +381,15 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     // these are strange, and probably shouldn't be used outside of
     // pipes. Specifically, the global version possible generates
     // incorrect code.
-    fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>] {
+    fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> Vec<P<ast::Ty>> {
         opt_vec::take_vec(
             ty_params.map(|p| self.ty_ident(DUMMY_SP, p.ident)))
     }
 
-    fn ty_vars_global(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>] {
+    fn ty_vars_global(&self, ty_params: &OptVec<ast::TyParam>) -> Vec<P<ast::Ty>> {
         opt_vec::take_vec(
             ty_params.map(|p| self.ty_path(
-                self.path_global(DUMMY_SP, ~[p.ident]), None)))
+                self.path_global(DUMMY_SP, vec!(p.ident)), None)))
     }
 
     fn strip_bounds(&self, generics: &Generics) -> Generics {
@@ -459,17 +461,17 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         @respan(sp, ast::StmtDecl(@decl, ast::DUMMY_NODE_ID))
     }
 
-    fn block(&self, span: Span, stmts: ~[@ast::Stmt], expr: Option<@Expr>) -> P<ast::Block> {
-        self.block_all(span, ~[], stmts, expr)
+    fn block(&self, span: Span, stmts: Vec<@ast::Stmt> , expr: Option<@Expr>) -> P<ast::Block> {
+        self.block_all(span, Vec::new(), stmts, expr)
     }
 
     fn block_expr(&self, expr: @ast::Expr) -> P<ast::Block> {
-        self.block_all(expr.span, ~[], ~[], Some(expr))
+        self.block_all(expr.span, Vec::new(), Vec::new(), Some(expr))
     }
     fn block_all(&self,
                  span: Span,
-                 view_items: ~[ast::ViewItem],
-                 stmts: ~[@ast::Stmt],
+                 view_items: Vec<ast::ViewItem> ,
+                 stmts: Vec<@ast::Stmt> ,
                  expr: Option<@ast::Expr>) -> P<ast::Block> {
             P(ast::Block {
                view_items: view_items,
@@ -517,7 +519,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     }
 
     fn expr_field_access(&self, sp: Span, expr: @ast::Expr, ident: ast::Ident) -> @ast::Expr {
-        self.expr(sp, ast::ExprField(expr, ident, ~[]))
+        self.expr(sp, ast::ExprField(expr, ident, Vec::new()))
     }
     fn expr_addr_of(&self, sp: Span, e: @ast::Expr) -> @ast::Expr {
         self.expr(sp, ast::ExprAddrOf(ast::MutImmutable, e))
@@ -526,23 +528,23 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         self.expr(sp, ast::ExprAddrOf(ast::MutMutable, e))
     }
 
-    fn expr_call(&self, span: Span, expr: @ast::Expr, args: ~[@ast::Expr]) -> @ast::Expr {
+    fn expr_call(&self, span: Span, expr: @ast::Expr, args: Vec<@ast::Expr> ) -> @ast::Expr {
         self.expr(span, ast::ExprCall(expr, args))
     }
-    fn expr_call_ident(&self, span: Span, id: ast::Ident, args: ~[@ast::Expr]) -> @ast::Expr {
+    fn expr_call_ident(&self, span: Span, id: ast::Ident, args: Vec<@ast::Expr> ) -> @ast::Expr {
         self.expr(span, ast::ExprCall(self.expr_ident(span, id), args))
     }
-    fn expr_call_global(&self, sp: Span, fn_path: ~[ast::Ident],
-                      args: ~[@ast::Expr]) -> @ast::Expr {
+    fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident> ,
+                      args: Vec<@ast::Expr> ) -> @ast::Expr {
         let pathexpr = self.expr_path(self.path_global(sp, fn_path));
         self.expr_call(sp, pathexpr, args)
     }
     fn expr_method_call(&self, span: Span,
                         expr: @ast::Expr,
                         ident: ast::Ident,
-                        mut args: ~[@ast::Expr]) -> @ast::Expr {
+                        mut args: Vec<@ast::Expr> ) -> @ast::Expr {
         args.unshift(expr);
-        self.expr(span, ast::ExprMethodCall(ident, ~[], args))
+        self.expr(span, ast::ExprMethodCall(ident, Vec::new(), args))
     }
     fn expr_block(&self, b: P<ast::Block>) -> @ast::Expr {
         self.expr(b.span, ast::ExprBlock(b))
@@ -550,11 +552,11 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn field_imm(&self, span: Span, name: Ident, e: @ast::Expr) -> ast::Field {
         ast::Field { ident: respan(span, name), expr: e, span: span }
     }
-    fn expr_struct(&self, span: Span, path: ast::Path, fields: ~[ast::Field]) -> @ast::Expr {
+    fn expr_struct(&self, span: Span, path: ast::Path, fields: Vec<ast::Field> ) -> @ast::Expr {
         self.expr(span, ast::ExprStruct(path, fields, None))
     }
     fn expr_struct_ident(&self, span: Span,
-                         id: ast::Ident, fields: ~[ast::Field]) -> @ast::Expr {
+                         id: ast::Ident, fields: Vec<ast::Field> ) -> @ast::Expr {
         self.expr_struct(span, self.path_ident(span, id), fields)
     }
 
@@ -577,13 +579,18 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn expr_vstore(&self, sp: Span, expr: @ast::Expr, vst: ast::ExprVstore) -> @ast::Expr {
         self.expr(sp, ast::ExprVstore(expr, vst))
     }
-    fn expr_vec(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr {
+    fn expr_vec(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr {
         self.expr(sp, ast::ExprVec(exprs, ast::MutImmutable))
     }
-    fn expr_vec_uniq(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr {
-        self.expr_vstore(sp, self.expr_vec(sp, exprs), ast::ExprVstoreUniq)
+    fn expr_vec_ng(&self, sp: Span) -> @ast::Expr {
+        self.expr_call_global(sp,
+                              vec!(self.ident_of("std"),
+                                   self.ident_of("vec_ng"),
+                                   self.ident_of("Vec"),
+                                   self.ident_of("new")),
+                              Vec::new())
     }
-    fn expr_vec_slice(&self, sp: Span, exprs: ~[@ast::Expr]) -> @ast::Expr {
+    fn expr_vec_slice(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr {
         self.expr_vstore(sp, self.expr_vec(sp, exprs), ast::ExprVstoreSlice)
     }
     fn expr_str(&self, sp: Span, s: InternedString) -> @ast::Expr {
@@ -600,20 +607,18 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
 
 
     fn expr_some(&self, sp: Span, expr: @ast::Expr) -> @ast::Expr {
-        let some = ~[
+        let some = vec!(
             self.ident_of("std"),
             self.ident_of("option"),
-            self.ident_of("Some"),
-        ];
-        self.expr_call_global(sp, some, ~[expr])
+            self.ident_of("Some"));
+        self.expr_call_global(sp, some, vec!(expr))
     }
 
     fn expr_none(&self, sp: Span) -> @ast::Expr {
-        let none = self.path_global(sp, ~[
+        let none = self.path_global(sp, vec!(
             self.ident_of("std"),
             self.ident_of("option"),
-            self.ident_of("None"),
-        ]);
+            self.ident_of("None")));
         self.expr_path(none)
     }
 
@@ -621,17 +626,15 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         let loc = self.codemap().lookup_char_pos(span.lo);
         self.expr_call_global(
             span,
-            ~[
+            vec!(
                 self.ident_of("std"),
                 self.ident_of("rt"),
-                self.ident_of("begin_unwind"),
-            ],
-            ~[
+                self.ident_of("begin_unwind")),
+            vec!(
                 self.expr_str(span, msg),
                 self.expr_str(span,
                               token::intern_and_get_ident(loc.file.name)),
-                self.expr_uint(span, loc.line),
-            ])
+                self.expr_uint(span, loc.line)))
     }
 
     fn expr_unreachable(&self, span: Span) -> @ast::Expr {
@@ -662,17 +665,17 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         let pat = ast::PatIdent(bm, path, None);
         self.pat(span, pat)
     }
-    fn pat_enum(&self, span: Span, path: ast::Path, subpats: ~[@ast::Pat]) -> @ast::Pat {
+    fn pat_enum(&self, span: Span, path: ast::Path, subpats: Vec<@ast::Pat> ) -> @ast::Pat {
         let pat = ast::PatEnum(path, Some(subpats));
         self.pat(span, pat)
     }
     fn pat_struct(&self, span: Span,
-                  path: ast::Path, field_pats: ~[ast::FieldPat]) -> @ast::Pat {
+                  path: ast::Path, field_pats: Vec<ast::FieldPat> ) -> @ast::Pat {
         let pat = ast::PatStruct(path, field_pats, false);
         self.pat(span, pat)
     }
 
-    fn arm(&self, _span: Span, pats: ~[@ast::Pat], expr: @ast::Expr) -> ast::Arm {
+    fn arm(&self, _span: Span, pats: Vec<@ast::Pat> , expr: @ast::Expr) -> ast::Arm {
         ast::Arm {
             pats: pats,
             guard: None,
@@ -681,10 +684,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     }
 
     fn arm_unreachable(&self, span: Span) -> ast::Arm {
-        self.arm(span, ~[self.pat_wild(span)], self.expr_unreachable(span))
+        self.arm(span, vec!(self.pat_wild(span)), self.expr_unreachable(span))
     }
 
-    fn expr_match(&self, span: Span, arg: @ast::Expr, arms: ~[ast::Arm]) -> @Expr {
+    fn expr_match(&self, span: Span, arg: @ast::Expr, arms: Vec<ast::Arm> ) -> @Expr {
         self.expr(span, ast::ExprMatch(arg, arms))
     }
 
@@ -698,24 +701,22 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
                       fn_decl: P<ast::FnDecl>, blk: P<ast::Block>) -> @ast::Expr {
         self.expr(span, ast::ExprFnBlock(fn_decl, blk))
     }
-    fn lambda(&self, span: Span, ids: ~[ast::Ident], blk: P<ast::Block>) -> @ast::Expr {
+    fn lambda(&self, span: Span, ids: Vec<ast::Ident> , blk: P<ast::Block>) -> @ast::Expr {
         let fn_decl = self.fn_decl(
             ids.map(|id| self.arg(span, *id, self.ty_infer(span))),
             self.ty_infer(span));
 
         self.expr(span, ast::ExprFnBlock(fn_decl, blk))
     }
-    fn lambda0(&self, _span: Span, blk: P<ast::Block>) -> @ast::Expr {
-        let blk_e = self.expr(blk.span, ast::ExprBlock(blk));
-        quote_expr!(self, || $blk_e )
+    fn lambda0(&self, span: Span, blk: P<ast::Block>) -> @ast::Expr {
+        self.lambda(span, Vec::new(), blk)
     }
 
-    fn lambda1(&self, _span: Span, blk: P<ast::Block>, ident: ast::Ident) -> @ast::Expr {
-        let blk_e = self.expr(blk.span, ast::ExprBlock(blk));
-        quote_expr!(self, |$ident| $blk_e )
+    fn lambda1(&self, span: Span, blk: P<ast::Block>, ident: ast::Ident) -> @ast::Expr {
+        self.lambda(span, vec!(ident), blk)
     }
 
-    fn lambda_expr(&self, span: Span, ids: ~[ast::Ident], expr: @ast::Expr) -> @ast::Expr {
+    fn lambda_expr(&self, span: Span, ids: Vec<ast::Ident> , expr: @ast::Expr) -> @ast::Expr {
         self.lambda(span, ids, self.block_expr(expr))
     }
     fn lambda_expr_0(&self, span: Span, expr: @ast::Expr) -> @ast::Expr {
@@ -725,13 +726,17 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         self.lambda1(span, self.block_expr(expr), ident)
     }
 
-    fn lambda_stmts(&self, span: Span, ids: ~[ast::Ident], stmts: ~[@ast::Stmt]) -> @ast::Expr {
+    fn lambda_stmts(&self,
+                    span: Span,
+                    ids: Vec<ast::Ident>,
+                    stmts: Vec<@ast::Stmt>)
+                    -> @ast::Expr {
         self.lambda(span, ids, self.block(span, stmts, None))
     }
-    fn lambda_stmts_0(&self, span: Span, stmts: ~[@ast::Stmt]) -> @ast::Expr {
+    fn lambda_stmts_0(&self, span: Span, stmts: Vec<@ast::Stmt> ) -> @ast::Expr {
         self.lambda0(span, self.block(span, stmts, None))
     }
-    fn lambda_stmts_1(&self, span: Span, stmts: ~[@ast::Stmt], ident: ast::Ident) -> @ast::Expr {
+    fn lambda_stmts_1(&self, span: Span, stmts: Vec<@ast::Stmt> , ident: ast::Ident) -> @ast::Expr {
         self.lambda1(span, self.block(span, stmts, None), ident)
     }
 
@@ -745,7 +750,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     }
 
     // FIXME unused self
-    fn fn_decl(&self, inputs: ~[ast::Arg], output: P<ast::Ty>) -> P<ast::FnDecl> {
+    fn fn_decl(&self, inputs: Vec<ast::Arg> , output: P<ast::Ty>) -> P<ast::FnDecl> {
         P(ast::FnDecl {
             inputs: inputs,
             output: output,
@@ -755,7 +760,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     }
 
     fn item(&self, span: Span,
-            name: Ident, attrs: ~[ast::Attribute], node: ast::Item_) -> @ast::Item {
+            name: Ident, attrs: Vec<ast::Attribute> , node: ast::Item_) -> @ast::Item {
         // FIXME: Would be nice if our generated code didn't violate
         // Rust coding conventions
         @ast::Item { ident: name,
@@ -769,13 +774,13 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn item_fn_poly(&self,
                     span: Span,
                     name: Ident,
-                    inputs: ~[ast::Arg],
+                    inputs: Vec<ast::Arg> ,
                     output: P<ast::Ty>,
                     generics: Generics,
                     body: P<ast::Block>) -> @ast::Item {
         self.item(span,
                   name,
-                  ~[],
+                  Vec::new(),
                   ast::ItemFn(self.fn_decl(inputs, output),
                               ast::ImpureFn,
                               AbiSet::Rust(),
@@ -786,7 +791,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn item_fn(&self,
                span: Span,
                name: Ident,
-               inputs: ~[ast::Arg],
+               inputs: Vec<ast::Arg> ,
                output: P<ast::Ty>,
                body: P<ast::Block>
               ) -> @ast::Item {
@@ -799,7 +804,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
             body)
     }
 
-    fn variant(&self, span: Span, name: Ident, tys: ~[P<ast::Ty>]) -> ast::Variant {
+    fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Variant {
         let args = tys.move_iter().map(|ty| {
             ast::VariantArg { ty: ty, id: ast::DUMMY_NODE_ID }
         }).collect();
@@ -807,7 +812,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
         respan(span,
                ast::Variant_ {
                    name: name,
-                   attrs: ~[],
+                   attrs: Vec::new(),
                    kind: ast::TupleVariantKind(args),
                    id: ast::DUMMY_NODE_ID,
                    disr_expr: None,
@@ -818,7 +823,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn item_enum_poly(&self, span: Span, name: Ident,
                       enum_definition: ast::EnumDef,
                       generics: Generics) -> @ast::Item {
-        self.item(span, name, ~[], ast::ItemEnum(enum_definition, generics))
+        self.item(span, name, Vec::new(), ast::ItemEnum(enum_definition, generics))
     }
 
     fn item_enum(&self, span: Span, name: Ident,
@@ -839,13 +844,13 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
 
     fn item_struct_poly(&self, span: Span, name: Ident,
         struct_def: ast::StructDef, generics: Generics) -> @ast::Item {
-        self.item(span, name, ~[], ast::ItemStruct(@struct_def, generics))
+        self.item(span, name, Vec::new(), ast::ItemStruct(@struct_def, generics))
     }
 
     fn item_mod(&self, span: Span, name: Ident,
-                attrs: ~[ast::Attribute],
-                vi: ~[ast::ViewItem],
-                items: ~[@ast::Item]) -> @ast::Item {
+                attrs: Vec<ast::Attribute> ,
+                vi: Vec<ast::ViewItem> ,
+                items: Vec<@ast::Item> ) -> @ast::Item {
         self.item(
             span,
             name,
@@ -859,7 +864,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
 
     fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
                     generics: Generics) -> @ast::Item {
-        self.item(span, name, ~[], ast::ItemTy(ty, generics))
+        self.item(span, name, Vec::new(), ast::ItemTy(ty, generics))
     }
 
     fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> @ast::Item {
@@ -880,7 +885,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn meta_list(&self,
                  sp: Span,
                  name: InternedString,
-                 mis: ~[@ast::MetaItem])
+                 mis: Vec<@ast::MetaItem> )
                  -> @ast::MetaItem {
         @respan(sp, ast::MetaList(name, mis))
     }
@@ -893,10 +898,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     }
 
     fn view_use(&self, sp: Span,
-                vis: ast::Visibility, vp: ~[@ast::ViewPath]) -> ast::ViewItem {
+                vis: ast::Visibility, vp: Vec<@ast::ViewPath> ) -> ast::ViewItem {
         ast::ViewItem {
             node: ast::ViewItemUse(vp),
-            attrs: ~[],
+            attrs: Vec::new(),
             vis: vis,
             span: sp
         }
@@ -910,30 +915,32 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn view_use_simple_(&self, sp: Span, vis: ast::Visibility,
                         ident: ast::Ident, path: ast::Path) -> ast::ViewItem {
         self.view_use(sp, vis,
-                      ~[@respan(sp,
+                      vec!(@respan(sp,
                                 ast::ViewPathSimple(ident,
                                                     path,
-                                                    ast::DUMMY_NODE_ID))])
+                                                    ast::DUMMY_NODE_ID))))
     }
 
     fn view_use_list(&self, sp: Span, vis: ast::Visibility,
-                     path: ~[ast::Ident], imports: &[ast::Ident]) -> ast::ViewItem {
+                     path: Vec<ast::Ident> , imports: &[ast::Ident]) -> ast::ViewItem {
         let imports = imports.map(|id| {
             respan(sp, ast::PathListIdent_ { name: *id, id: ast::DUMMY_NODE_ID })
         });
 
         self.view_use(sp, vis,
-                      ~[@respan(sp,
+                      vec!(@respan(sp,
                                 ast::ViewPathList(self.path(sp, path),
-                                                  imports,
-                                                  ast::DUMMY_NODE_ID))])
+                                                  imports.iter()
+                                                         .map(|x| *x)
+                                                         .collect(),
+                                                  ast::DUMMY_NODE_ID))))
     }
 
     fn view_use_glob(&self, sp: Span,
-                     vis: ast::Visibility, path: ~[ast::Ident]) -> ast::ViewItem {
+                     vis: ast::Visibility, path: Vec<ast::Ident> ) -> ast::ViewItem {
         self.view_use(sp, vis,
-                      ~[@respan(sp,
-                                ast::ViewPathGlob(self.path(sp, path), ast::DUMMY_NODE_ID))])
+                      vec!(@respan(sp,
+                                ast::ViewPathGlob(self.path(sp, path), ast::DUMMY_NODE_ID))))
     }
 }
 
diff --git a/src/libsyntax/ext/bytes.rs b/src/libsyntax/ext/bytes.rs
index 68aa757c524..6123fd4d3d4 100644
--- a/src/libsyntax/ext/bytes.rs
+++ b/src/libsyntax/ext/bytes.rs
@@ -17,6 +17,7 @@ use ext::base;
 use ext::build::AstBuilder;
 
 use std::char;
+use std::vec_ng::Vec;
 
 pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> base::MacResult {
     // Gather all argument expressions
@@ -24,7 +25,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
         None => return MacResult::dummy_expr(sp),
         Some(e) => e,
     };
-    let mut bytes = ~[];
+    let mut bytes = Vec::new();
 
     for expr in exprs.iter() {
         match expr.node {
diff --git a/src/libsyntax/ext/cfg.rs b/src/libsyntax/ext/cfg.rs
index 295c456c9d0..5d11a0d1e2f 100644
--- a/src/libsyntax/ext/cfg.rs
+++ b/src/libsyntax/ext/cfg.rs
@@ -26,12 +26,16 @@ use parse::token::InternedString;
 use parse::token;
 use parse;
 
+use std::vec_ng::Vec;
+
 pub fn expand_cfg(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> base::MacResult {
     let mut p = parse::new_parser_from_tts(cx.parse_sess(),
                                            cx.cfg(),
-                                           tts.to_owned());
+                                           tts.iter()
+                                              .map(|x| (*x).clone())
+                                              .collect());
 
-    let mut cfgs = ~[];
+    let mut cfgs = Vec::new();
     // parse `cfg!(meta_item, meta_item(x,y), meta_item="foo", ...)`
     while p.token != token::EOF {
         cfgs.push(p.parse_meta_item());
@@ -42,7 +46,8 @@ pub fn expand_cfg(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> base::M
     // test_cfg searches for meta items looking like `cfg(foo, ...)`
     let in_cfg = &[cx.meta_list(sp, InternedString::new("cfg"), cfgs)];
 
-    let matches_cfg = attr::test_cfg(cx.cfg(), in_cfg.iter().map(|&x| x));
+    let matches_cfg = attr::test_cfg(cx.cfg().as_slice(),
+                                     in_cfg.iter().map(|&x| x));
     let e = cx.expr_bool(sp, matches_cfg);
     MRExpr(e)
 }
diff --git a/src/libsyntax/ext/concat_idents.rs b/src/libsyntax/ext/concat_idents.rs
index 85cfd4f61e4..25525869398 100644
--- a/src/libsyntax/ext/concat_idents.rs
+++ b/src/libsyntax/ext/concat_idents.rs
@@ -48,13 +48,13 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
             ast::Path {
                  span: sp,
                  global: false,
-                 segments: ~[
+                 segments: vec!(
                     ast::PathSegment {
                         identifier: res,
                         lifetimes: opt_vec::Empty,
                         types: opt_vec::Empty,
                     }
-                ]
+                )
             }
         ),
         span: sp,
diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs
index f52a2accd8d..feda1694ff1 100644
--- a/src/libsyntax/ext/deriving/clone.rs
+++ b/src/libsyntax/ext/deriving/clone.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_clone(cx: &mut ExtCtxt,
                              span: Span,
                              mitem: @MetaItem,
@@ -21,22 +23,22 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt,
                              push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "clone", "Clone"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "clone", "Clone")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "clone",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[],
+                args: Vec::new(),
                 ret_ty: Self,
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: |c, s, sub| cs_clone("Clone", c, s, sub)
             }
-        ]
+        )
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -49,16 +51,16 @@ pub fn expand_deriving_deep_clone(cx: &mut ExtCtxt,
                                   push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "clone", "DeepClone"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "clone", "DeepClone")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "deep_clone",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[],
+                args: Vec::new(),
                 ret_ty: Self,
                 inline: true,
                 const_nonmatching: false,
@@ -66,7 +68,7 @@ pub fn expand_deriving_deep_clone(cx: &mut ExtCtxt,
                 // call deep_clone (not clone) here.
                 combine_substructure: |c, s, sub| cs_clone("DeepClone", c, s, sub)
             }
-        ]
+        )
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -80,7 +82,7 @@ fn cs_clone(
     let ctor_ident;
     let all_fields;
     let subcall = |field: &FieldInfo|
-        cx.expr_method_call(field.span, field.self_, clone_ident, ~[]);
+        cx.expr_method_call(field.span, field.self_, clone_ident, Vec::new());
 
     match *substr.fields {
         Struct(ref af) => {
@@ -99,7 +101,7 @@ fn cs_clone(
                                                                  name))
     }
 
-    if all_fields.len() >= 1 && all_fields[0].name.is_none() {
+    if all_fields.len() >= 1 && all_fields.get(0).name.is_none() {
         // enum-like
         let subcalls = all_fields.map(subcall);
         cx.expr_call_ident(trait_span, ctor_ident, subcalls)
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs
index b031f69084d..1e7199ccc95 100644
--- a/src/libsyntax/ext/deriving/cmp/eq.rs
+++ b/src/libsyntax/ext/deriving/cmp/eq.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_eq(cx: &mut ExtCtxt,
                           span: Span,
                           mitem: @MetaItem,
@@ -36,8 +38,8 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
                 name: $name,
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[borrowed_self()],
-                ret_ty: Literal(Path::new(~["bool"])),
+                args: vec!(borrowed_self()),
+                ret_ty: Literal(Path::new(vec!("bool"))),
                 inline: true,
                 const_nonmatching: true,
                 combine_substructure: $f
@@ -47,14 +49,14 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
 
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "cmp", "Eq"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "cmp", "Eq")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             md!("eq", cs_eq),
             md!("ne", cs_ne)
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs
index 10a416045cb..66f45988239 100644
--- a/src/libsyntax/ext/deriving/cmp/ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/ord.rs
@@ -15,6 +15,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_ord(cx: &mut ExtCtxt,
                            span: Span,
                            mitem: @MetaItem,
@@ -26,8 +28,8 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt,
                 name: $name,
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[borrowed_self()],
-                ret_ty: Literal(Path::new(~["bool"])),
+                args: vec!(borrowed_self()),
+                ret_ty: Literal(Path::new(vec!("bool"))),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: |cx, span, substr| cs_op($op, $equal, cx, span, substr)
@@ -37,16 +39,16 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt,
 
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "cmp", "Ord"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "cmp", "Ord")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             md!("lt", true, false),
             md!("le", true, true),
             md!("gt", false, false),
             md!("ge", false, true)
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs
index 2bfab8646a6..2b3c0b9ea69 100644
--- a/src/libsyntax/ext/deriving/cmp/totaleq.rs
+++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_totaleq(cx: &mut ExtCtxt,
                                span: Span,
                                mitem: @MetaItem,
@@ -26,22 +28,22 @@ pub fn expand_deriving_totaleq(cx: &mut ExtCtxt,
 
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "cmp", "TotalEq"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "cmp", "TotalEq")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "equals",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[borrowed_self()],
-                ret_ty: Literal(Path::new(~["bool"])),
+                args: vec!(borrowed_self()),
+                ret_ty: Literal(Path::new(vec!("bool"))),
                 inline: true,
                 const_nonmatching: true,
                 combine_substructure: cs_equals
             }
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs
index 2e6c4a54228..89a344bdb7b 100644
--- a/src/libsyntax/ext/deriving/cmp/totalord.rs
+++ b/src/libsyntax/ext/deriving/cmp/totalord.rs
@@ -14,7 +14,9 @@ use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
+
 use std::cmp::{Ordering, Equal, Less, Greater};
+use std::vec_ng::Vec;
 
 pub fn expand_deriving_totalord(cx: &mut ExtCtxt,
                                 span: Span,
@@ -23,22 +25,22 @@ pub fn expand_deriving_totalord(cx: &mut ExtCtxt,
                                 push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "cmp", "TotalOrd"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "cmp", "TotalOrd")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "cmp",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[borrowed_self()],
-                ret_ty: Literal(Path::new(~["std", "cmp", "Ordering"])),
+                args: vec!(borrowed_self()),
+                ret_ty: Literal(Path::new(vec!("std", "cmp", "Ordering"))),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: cs_cmp
             }
-        ]
+        )
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -52,9 +54,9 @@ pub fn ordering_const(cx: &mut ExtCtxt, span: Span, cnst: Ordering) -> ast::Path
         Greater => "Greater"
     };
     cx.path_global(span,
-                   ~[cx.ident_of("std"),
+                   vec!(cx.ident_of("std"),
                      cx.ident_of("cmp"),
-                     cx.ident_of(cnst)])
+                     cx.ident_of(cnst)))
 }
 
 pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
@@ -99,7 +101,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
             let if_ = cx.expr_if(span,
                                  cond,
                                  old, Some(cx.expr_ident(span, test_id)));
-            cx.expr_block(cx.block(span, ~[assign], Some(if_)))
+            cx.expr_block(cx.block(span, vec!(assign), Some(if_)))
         },
         cx.expr_path(equals_path.clone()),
         |cx, span, list, _| {
diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs
index 7aaa66cbfb5..bc6d69c7cca 100644
--- a/src/libsyntax/ext/deriving/decodable.rs
+++ b/src/libsyntax/ext/deriving/decodable.rs
@@ -21,6 +21,8 @@ use ext::deriving::generic::*;
 use parse::token::InternedString;
 use parse::token;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_decodable(cx: &mut ExtCtxt,
                                  span: Span,
                                  mitem: @MetaItem,
@@ -28,27 +30,26 @@ pub fn expand_deriving_decodable(cx: &mut ExtCtxt,
                                  push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new_(~["serialize", "Decodable"], None,
-                         ~[~Literal(Path::new_local("__D"))], true),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new_(vec!("serialize", "Decodable"), None,
+                         vec!(~Literal(Path::new_local("__D"))), true),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds {
-            lifetimes: ~[],
-            bounds: ~[("__D", ~[Path::new(~["serialize", "Decoder"])])],
+            lifetimes: Vec::new(),
+            bounds: vec!(("__D", vec!(Path::new(vec!("serialize", "Decoder"))))),
         },
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "decode",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[Ptr(~Literal(Path::new_local("__D")),
-                            Borrowed(None, MutMutable))],
+                args: vec!(Ptr(~Literal(Path::new_local("__D")),
+                            Borrowed(None, MutMutable))),
                 ret_ty: Self,
                 inline: false,
                 const_nonmatching: true,
                 combine_substructure: decodable_substructure,
-            },
-        ]
+            })
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -57,13 +58,13 @@ pub fn expand_deriving_decodable(cx: &mut ExtCtxt,
 fn decodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
                           substr: &Substructure) -> @Expr {
     let decoder = substr.nonself_args[0];
-    let recurse = ~[cx.ident_of("serialize"),
+    let recurse = vec!(cx.ident_of("serialize"),
                     cx.ident_of("Decodable"),
-                    cx.ident_of("decode")];
+                    cx.ident_of("decode"));
     // throw an underscore in front to suppress unused variable warnings
     let blkarg = cx.ident_of("_d");
     let blkdecoder = cx.expr_ident(trait_span, blkarg);
-    let calldecode = cx.expr_call_global(trait_span, recurse, ~[blkdecoder]);
+    let calldecode = cx.expr_call_global(trait_span, recurse, vec!(blkdecoder));
     let lambdadecode = cx.lambda_expr_1(trait_span, calldecode, blkarg);
 
     return match *substr.fields {
@@ -80,24 +81,24 @@ fn decodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
                                               summary,
                                               |cx, span, name, field| {
                 cx.expr_method_call(span, blkdecoder, read_struct_field,
-                                    ~[cx.expr_str(span, name),
+                                    vec!(cx.expr_str(span, name),
                                       cx.expr_uint(span, field),
-                                      lambdadecode])
+                                      lambdadecode))
             });
             cx.expr_method_call(trait_span,
                                 decoder,
                                 cx.ident_of("read_struct"),
-                                ~[
+                                vec!(
                 cx.expr_str(trait_span, token::get_ident(substr.type_ident)),
                 cx.expr_uint(trait_span, nfields),
                 cx.lambda_expr_1(trait_span, result, blkarg)
-            ])
+            ))
         }
         StaticEnum(_, ref fields) => {
             let variant = cx.ident_of("i");
 
-            let mut arms = ~[];
-            let mut variants = ~[];
+            let mut arms = Vec::new();
+            let mut variants = Vec::new();
             let rvariant_arg = cx.ident_of("read_enum_variant_arg");
 
             for (i, &(name, v_span, ref parts)) in fields.iter().enumerate() {
@@ -110,29 +111,29 @@ fn decodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
                                                    |cx, span, _, field| {
                     let idx = cx.expr_uint(span, field);
                     cx.expr_method_call(span, blkdecoder, rvariant_arg,
-                                        ~[idx, lambdadecode])
+                                        vec!(idx, lambdadecode))
                 });
 
                 arms.push(cx.arm(v_span,
-                                 ~[cx.pat_lit(v_span, cx.expr_uint(v_span, i))],
+                                 vec!(cx.pat_lit(v_span, cx.expr_uint(v_span, i))),
                                  decoded));
             }
 
             arms.push(cx.arm_unreachable(trait_span));
 
             let result = cx.expr_match(trait_span, cx.expr_ident(trait_span, variant), arms);
-            let lambda = cx.lambda_expr(trait_span, ~[blkarg, variant], result);
+            let lambda = cx.lambda_expr(trait_span, vec!(blkarg, variant), result);
             let variant_vec = cx.expr_vec(trait_span, variants);
             let result = cx.expr_method_call(trait_span, blkdecoder,
                                              cx.ident_of("read_enum_variant"),
-                                             ~[variant_vec, lambda]);
+                                             vec!(variant_vec, lambda));
             cx.expr_method_call(trait_span,
                                 decoder,
                                 cx.ident_of("read_enum"),
-                                ~[
+                                vec!(
                 cx.expr_str(trait_span, token::get_ident(substr.type_ident)),
                 cx.lambda_expr_1(trait_span, result, blkarg)
-            ])
+            ))
         }
         _ => cx.bug("expected StaticEnum or StaticStruct in deriving(Decodable)")
     };
diff --git a/src/libsyntax/ext/deriving/default.rs b/src/libsyntax/ext/deriving/default.rs
index c5ef86273b6..8259459f57a 100644
--- a/src/libsyntax/ext/deriving/default.rs
+++ b/src/libsyntax/ext/deriving/default.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_default(cx: &mut ExtCtxt,
                             span: Span,
                             mitem: @MetaItem,
@@ -21,34 +23,33 @@ pub fn expand_deriving_default(cx: &mut ExtCtxt,
                             push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "default", "Default"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "default", "Default")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "default",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[],
+                args: Vec::new(),
                 ret_ty: Self,
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: default_substructure
-            },
-        ]
+            })
     };
     trait_def.expand(cx, mitem, item, push)
 }
 
 fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
-    let default_ident = ~[
+    let default_ident = vec!(
         cx.ident_of("std"),
         cx.ident_of("default"),
         cx.ident_of("Default"),
         cx.ident_of("default")
-    ];
-    let default_call = |span| cx.expr_call_global(span, default_ident.clone(), ~[]);
+    );
+    let default_call = |span| cx.expr_call_global(span, default_ident.clone(), Vec::new());
 
     return match *substr.fields {
         StaticStruct(_, ref summary) => {
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs
index ae23013b7cc..091ff7b9c90 100644
--- a/src/libsyntax/ext/deriving/encodable.rs
+++ b/src/libsyntax/ext/deriving/encodable.rs
@@ -89,6 +89,8 @@ use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 use parse::token;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_encodable(cx: &mut ExtCtxt,
                                  span: Span,
                                  mitem: @MetaItem,
@@ -96,27 +98,26 @@ pub fn expand_deriving_encodable(cx: &mut ExtCtxt,
                                  push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new_(~["serialize", "Encodable"], None,
-                         ~[~Literal(Path::new_local("__E"))], true),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new_(vec!("serialize", "Encodable"), None,
+                         vec!(~Literal(Path::new_local("__E"))), true),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds {
-            lifetimes: ~[],
-            bounds: ~[("__E", ~[Path::new(~["serialize", "Encoder"])])],
+            lifetimes: Vec::new(),
+            bounds: vec!(("__E", vec!(Path::new(vec!("serialize", "Encoder"))))),
         },
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "encode",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[Ptr(~Literal(Path::new_local("__E")),
-                            Borrowed(None, MutMutable))],
+                args: vec!(Ptr(~Literal(Path::new_local("__E")),
+                            Borrowed(None, MutMutable))),
                 ret_ty: nil_ty(),
                 inline: false,
                 const_nonmatching: true,
                 combine_substructure: encodable_substructure,
-            },
-        ]
+            })
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -133,7 +134,7 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
     return match *substr.fields {
         Struct(ref fields) => {
             let emit_struct_field = cx.ident_of("emit_struct_field");
-            let mut stmts = ~[];
+            let mut stmts = Vec::new();
             for (i, &FieldInfo {
                     name,
                     self_,
@@ -146,13 +147,13 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
                         token::intern_and_get_ident(format!("_field{}", i))
                     }
                 };
-                let enc = cx.expr_method_call(span, self_, encode, ~[blkencoder]);
+                let enc = cx.expr_method_call(span, self_, encode, vec!(blkencoder));
                 let lambda = cx.lambda_expr_1(span, enc, blkarg);
                 let call = cx.expr_method_call(span, blkencoder,
                                                emit_struct_field,
-                                               ~[cx.expr_str(span, name),
+                                               vec!(cx.expr_str(span, name),
                                                  cx.expr_uint(span, i),
-                                                 lambda]);
+                                                 lambda));
                 stmts.push(cx.stmt_expr(call));
             }
 
@@ -160,11 +161,11 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
             cx.expr_method_call(trait_span,
                                 encoder,
                                 cx.ident_of("emit_struct"),
-                                ~[
+                                vec!(
                 cx.expr_str(trait_span, token::get_ident(substr.type_ident)),
                 cx.expr_uint(trait_span, fields.len()),
                 blk
-            ])
+            ))
         }
 
         EnumMatching(idx, variant, ref fields) => {
@@ -175,14 +176,14 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
             let me = cx.stmt_let(trait_span, false, blkarg, encoder);
             let encoder = cx.expr_ident(trait_span, blkarg);
             let emit_variant_arg = cx.ident_of("emit_enum_variant_arg");
-            let mut stmts = ~[];
+            let mut stmts = Vec::new();
             for (i, &FieldInfo { self_, span, .. }) in fields.iter().enumerate() {
-                let enc = cx.expr_method_call(span, self_, encode, ~[blkencoder]);
+                let enc = cx.expr_method_call(span, self_, encode, vec!(blkencoder));
                 let lambda = cx.lambda_expr_1(span, enc, blkarg);
                 let call = cx.expr_method_call(span, blkencoder,
                                                emit_variant_arg,
-                                               ~[cx.expr_uint(span, i),
-                                                 lambda]);
+                                               vec!(cx.expr_uint(span, i),
+                                                 lambda));
                 stmts.push(cx.stmt_expr(call));
             }
 
@@ -190,19 +191,19 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
             let name = cx.expr_str(trait_span, token::get_ident(variant.node.name));
             let call = cx.expr_method_call(trait_span, blkencoder,
                                            cx.ident_of("emit_enum_variant"),
-                                           ~[name,
+                                           vec!(name,
                                              cx.expr_uint(trait_span, idx),
                                              cx.expr_uint(trait_span, fields.len()),
-                                             blk]);
+                                             blk));
             let blk = cx.lambda_expr_1(trait_span, call, blkarg);
             let ret = cx.expr_method_call(trait_span,
                                           encoder,
                                           cx.ident_of("emit_enum"),
-                                          ~[
+                                          vec!(
                 cx.expr_str(trait_span, token::get_ident(substr.type_ident)),
                 blk
-            ]);
-            cx.expr_block(cx.block(trait_span, ~[me], Some(ret)))
+            ));
+            cx.expr_block(cx.block(trait_span, vec!(me), Some(ret)))
         }
 
         _ => cx.bug("expected Struct or EnumMatching in deriving(Encodable)")
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index 24d4efb1b0e..1dc474551cf 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -188,7 +188,8 @@ use opt_vec;
 use parse::token::InternedString;
 use parse::token;
 
-use std::vec;
+use std::vec_ng::Vec;
+use std::vec_ng;
 
 pub use self::ty::*;
 mod ty;
@@ -197,20 +198,19 @@ pub struct TraitDef<'a> {
     /// The span for the current #[deriving(Foo)] header.
     span: Span,
 
-    attributes: ~[ast::Attribute],
+    attributes: Vec<ast::Attribute> ,
 
     /// Path of the trait, including any type parameters
     path: Path<'a>,
 
     /// Additional bounds required of any type parameters of the type,
     /// other than the current trait
-    additional_bounds: ~[Ty<'a>],
+    additional_bounds: Vec<Ty<'a>> ,
 
     /// Any extra lifetimes and/or bounds, e.g. `D: serialize::Decoder`
     generics: LifetimeBounds<'a>,
 
-    methods: ~[MethodDef<'a>]
-}
+    methods: Vec<MethodDef<'a>> }
 
 
 pub struct MethodDef<'a> {
@@ -225,7 +225,7 @@ pub struct MethodDef<'a> {
     explicit_self: Option<Option<PtrTy<'a>>>,
 
     /// Arguments other than the self argument
-    args: ~[Ty<'a>],
+    args: Vec<Ty<'a>> ,
 
     /// Return type
     ret_ty: Ty<'a>,
@@ -264,39 +264,38 @@ pub struct FieldInfo {
     self_: @Expr,
     /// The expressions corresponding to references to this field in
     /// the other Self arguments.
-    other: ~[@Expr]
-}
+    other: Vec<@Expr> }
 
 /// Fields for a static method
 pub enum StaticFields {
     /// Tuple structs/enum variants like this
-    Unnamed(~[Span]),
+    Unnamed(Vec<Span> ),
     /// Normal structs/struct variants.
-    Named(~[(Ident, Span)])
+    Named(Vec<(Ident, Span)> )
 }
 
 /// A summary of the possible sets of fields. See above for details
 /// and examples
 pub enum SubstructureFields<'a> {
-    Struct(~[FieldInfo]),
+    Struct(Vec<FieldInfo> ),
     /**
     Matching variants of the enum: variant index, ast::Variant,
     fields: the field name is only non-`None` in the case of a struct
     variant.
     */
-    EnumMatching(uint, &'a ast::Variant, ~[FieldInfo]),
+    EnumMatching(uint, &'a ast::Variant, Vec<FieldInfo> ),
 
     /**
     non-matching variants of the enum, [(variant index, ast::Variant,
     [field span, field ident, fields])] (i.e. all fields for self are in the
     first tuple, for other1 are in the second tuple, etc.)
     */
-    EnumNonMatching(&'a [(uint, P<ast::Variant>, ~[(Span, Option<Ident>, @Expr)])]),
+    EnumNonMatching(&'a [(uint, P<ast::Variant>, Vec<(Span, Option<Ident>, @Expr)> )]),
 
     /// A static method where Self is a struct.
     StaticStruct(&'a ast::StructDef, StaticFields),
     /// A static method where Self is an enum.
-    StaticEnum(&'a ast::EnumDef, ~[(Ident, Span, StaticFields)])
+    StaticEnum(&'a ast::EnumDef, Vec<(Ident, Span, StaticFields)> )
 }
 
 
@@ -316,7 +315,7 @@ representing each variant: (variant index, ast::Variant instance,
 pub type EnumNonMatchFunc<'a> =
     'a |&mut ExtCtxt,
            Span,
-           &[(uint, P<ast::Variant>, ~[(Span, Option<Ident>, @Expr)])],
+           &[(uint, P<ast::Variant>, Vec<(Span, Option<Ident>, @Expr)> )],
            &[@Expr]|
            -> @Expr;
 
@@ -360,7 +359,7 @@ impl<'a> TraitDef<'a> {
                            cx: &mut ExtCtxt,
                            type_ident: Ident,
                            generics: &Generics,
-                           methods: ~[@ast::Method]) -> @ast::Item {
+                           methods: Vec<@ast::Method> ) -> @ast::Item {
         let trait_path = self.path.to_path(cx, self.span, type_ident, generics);
 
         let mut trait_generics = self.generics.to_generics(cx, self.span,
@@ -397,7 +396,7 @@ impl<'a> TraitDef<'a> {
 
         // Create the type of `self`.
         let self_type = cx.ty_path(
-            cx.path_all(self.span, false, ~[ type_ident ], self_lifetimes,
+            cx.path_all(self.span, false, vec!( type_ident ), self_lifetimes,
                         opt_vec::take_vec(self_ty_params)), None);
 
         let doc_attr = cx.attribute(
@@ -412,7 +411,7 @@ impl<'a> TraitDef<'a> {
         cx.item(
             self.span,
             ident,
-            vec::append(~[doc_attr], self.attributes),
+            vec_ng::append(vec!(doc_attr), self.attributes.as_slice()),
             ast::ItemImpl(trait_generics, opt_trait_ref,
                           self_type, methods.map(|x| *x)))
     }
@@ -433,13 +432,15 @@ impl<'a> TraitDef<'a> {
                     self,
                     struct_def,
                     type_ident,
-                    self_args, nonself_args)
+                    self_args.as_slice(),
+                    nonself_args.as_slice())
             } else {
                 method_def.expand_struct_method_body(cx,
                                                      self,
                                                      struct_def,
                                                      type_ident,
-                                                     self_args, nonself_args)
+                                                     self_args.as_slice(),
+                                                     nonself_args.as_slice())
             };
 
             method_def.create_method(cx, self,
@@ -467,13 +468,15 @@ impl<'a> TraitDef<'a> {
                     self,
                     enum_def,
                     type_ident,
-                    self_args, nonself_args)
+                    self_args.as_slice(),
+                    nonself_args.as_slice())
             } else {
                 method_def.expand_enum_method_body(cx,
                                                    self,
                                                    enum_def,
                                                    type_ident,
-                                                   self_args, nonself_args)
+                                                   self_args.as_slice(),
+                                                   nonself_args.as_slice())
             };
 
             method_def.create_method(cx, self,
@@ -524,11 +527,11 @@ impl<'a> MethodDef<'a> {
                                trait_: &TraitDef,
                                type_ident: Ident,
                                generics: &Generics)
-        -> (ast::ExplicitSelf, ~[@Expr], ~[@Expr], ~[(Ident, P<ast::Ty>)]) {
+        -> (ast::ExplicitSelf, Vec<@Expr> , Vec<@Expr> , Vec<(Ident, P<ast::Ty>)> ) {
 
-        let mut self_args = ~[];
-        let mut nonself_args = ~[];
-        let mut arg_tys = ~[];
+        let mut self_args = Vec::new();
+        let mut nonself_args = Vec::new();
+        let mut arg_tys = Vec::new();
         let mut nonstatic = false;
 
         let ast_explicit_self = match self.explicit_self {
@@ -575,7 +578,7 @@ impl<'a> MethodDef<'a> {
                      type_ident: Ident,
                      generics: &Generics,
                      explicit_self: ast::ExplicitSelf,
-                     arg_types: ~[(Ident, P<ast::Ty>)],
+                     arg_types: Vec<(Ident, P<ast::Ty>)> ,
                      body: @Expr) -> @ast::Method {
         // create the generics that aren't for Self
         let fn_generics = self.generics.to_generics(cx, trait_.span, type_ident, generics);
@@ -598,16 +601,16 @@ impl<'a> MethodDef<'a> {
         let body_block = cx.block_expr(body);
 
         let attrs = if self.inline {
-            ~[
+            vec!(
                 cx
                       .attribute(trait_.span,
                                  cx
                                        .meta_word(trait_.span,
                                                   InternedString::new(
                                                       "inline")))
-            ]
+            )
         } else {
-            ~[]
+            Vec::new()
         };
 
         // Create the method.
@@ -655,9 +658,9 @@ impl<'a> MethodDef<'a> {
                                  nonself_args: &[@Expr])
         -> @Expr {
 
-        let mut raw_fields = ~[]; // ~[[fields of self],
+        let mut raw_fields = Vec::new(); // ~[[fields of self],
                                  // [fields of next Self arg], [etc]]
-        let mut patterns = ~[];
+        let mut patterns = Vec::new();
         for i in range(0u, self_args.len()) {
             let (pat, ident_expr) = trait_.create_struct_pattern(cx, type_ident, struct_def,
                                                                  format!("__self_{}", i),
@@ -668,14 +671,15 @@ impl<'a> MethodDef<'a> {
 
         // transpose raw_fields
         let fields = if raw_fields.len() > 0 {
-            raw_fields[0].iter()
-                         .enumerate()
-                         .map(|(i, &(span, opt_id, field))| {
-                let other_fields = raw_fields.tail().map(|l| {
-                    match &l[i] {
+            raw_fields.get(0)
+                      .iter()
+                      .enumerate()
+                      .map(|(i, &(span, opt_id, field))| {
+                let other_fields = raw_fields.tail().iter().map(|l| {
+                    match l.get(i) {
                         &(_, _, ex) => ex
                     }
-                });
+                }).collect();
                 FieldInfo {
                     span: span,
                     name: opt_id,
@@ -703,7 +707,7 @@ impl<'a> MethodDef<'a> {
         // matter.
         for (&arg_expr, &pat) in self_args.iter().zip(patterns.iter()) {
             body = cx.expr_match(trait_.span, arg_expr,
-                                     ~[ cx.arm(trait_.span, ~[pat], body) ])
+                                     vec!( cx.arm(trait_.span, vec!(pat), body) ))
         }
         body
     }
@@ -759,7 +763,7 @@ impl<'a> MethodDef<'a> {
                                self_args: &[@Expr],
                                nonself_args: &[@Expr])
                                -> @Expr {
-        let mut matches = ~[];
+        let mut matches = Vec::new();
         self.build_enum_match(cx, trait_, enum_def, type_ident,
                               self_args, nonself_args,
                               None, &mut matches, 0)
@@ -795,8 +799,8 @@ impl<'a> MethodDef<'a> {
                         self_args: &[@Expr],
                         nonself_args: &[@Expr],
                         matching: Option<uint>,
-                        matches_so_far: &mut ~[(uint, P<ast::Variant>,
-                                              ~[(Span, Option<Ident>, @Expr)])],
+                        matches_so_far: &mut Vec<(uint, P<ast::Variant>,
+                                              Vec<(Span, Option<Ident>, @Expr)> )> ,
                         match_count: uint) -> @Expr {
         if match_count == self_args.len() {
             // we've matched against all arguments, so make the final
@@ -822,17 +826,17 @@ impl<'a> MethodDef<'a> {
                 Some(variant_index) => {
                     // `ref` inside let matches is buggy. Causes havoc wih rusc.
                     // let (variant_index, ref self_vec) = matches_so_far[0];
-                    let (variant, self_vec) = match matches_so_far[0] {
-                        (_, v, ref s) => (v, s)
+                    let (variant, self_vec) = match matches_so_far.get(0) {
+                        &(_, v, ref s) => (v, s)
                     };
 
-                    let mut enum_matching_fields = vec::from_elem(self_vec.len(), ~[]);
+                    let mut enum_matching_fields = Vec::from_elem(self_vec.len(), Vec::new());
 
                     for triple in matches_so_far.tail().iter() {
                         match triple {
                             &(_, _, ref other_fields) => {
                                 for (i, &(_, _, e)) in other_fields.iter().enumerate() {
-                                    enum_matching_fields[i].push(e);
+                                    enum_matching_fields.get_mut(i).push(e);
                                 }
                             }
                         }
@@ -851,7 +855,7 @@ impl<'a> MethodDef<'a> {
                     substructure = EnumMatching(variant_index, variant, field_tuples);
                 }
                 None => {
-                    substructure = EnumNonMatching(*matches_so_far);
+                    substructure = EnumNonMatching(matches_so_far.as_slice());
                 }
             }
             self.call_substructure_method(cx, trait_, type_ident,
@@ -865,7 +869,7 @@ impl<'a> MethodDef<'a> {
                 format!("__arg_{}", match_count)
             };
 
-            let mut arms = ~[];
+            let mut arms = Vec::new();
 
             // the code for nonmatching variants only matters when
             // we've seen at least one other variant already
@@ -879,7 +883,7 @@ impl<'a> MethodDef<'a> {
                 };
 
                 // matching-variant match
-                let variant = enum_def.variants[index];
+                let variant = *enum_def.variants.get(index);
                 let (pattern, idents) = trait_.create_enum_variant_pattern(cx,
                                                                            variant,
                                                                            current_match_str,
@@ -895,7 +899,7 @@ impl<'a> MethodDef<'a> {
                                                      matches_so_far,
                                                      match_count + 1);
                 matches_so_far.pop().unwrap();
-                arms.push(cx.arm(trait_.span, ~[ pattern ], arm_expr));
+                arms.push(cx.arm(trait_.span, vec!( pattern ), arm_expr));
 
                 if enum_def.variants.len() > 1 {
                     let e = &EnumNonMatching(&[]);
@@ -904,7 +908,7 @@ impl<'a> MethodDef<'a> {
                                                                   e);
                     let wild_arm = cx.arm(
                         trait_.span,
-                        ~[ cx.pat_wild(trait_.span) ],
+                        vec!( cx.pat_wild(trait_.span) ),
                         wild_expr);
                     arms.push(wild_arm);
                 }
@@ -933,7 +937,7 @@ impl<'a> MethodDef<'a> {
                                                          match_count + 1);
                     matches_so_far.pop().unwrap();
 
-                    let arm = cx.arm(trait_.span, ~[ pattern ], arm_expr);
+                    let arm = cx.arm(trait_.span, vec!( pattern ), arm_expr);
                     arms.push(arm);
                 }
             }
@@ -997,8 +1001,8 @@ impl<'a> TraitDef<'a> {
     fn summarise_struct(&self,
                         cx: &mut ExtCtxt,
                         struct_def: &StructDef) -> StaticFields {
-        let mut named_idents = ~[];
-        let mut just_spans = ~[];
+        let mut named_idents = Vec::new();
+        let mut just_spans = Vec::new();
         for field in struct_def.fields.iter(){
             let sp = self.set_expn_info(cx, field.span);
             match field.node.kind {
@@ -1020,9 +1024,9 @@ impl<'a> TraitDef<'a> {
 
     fn create_subpatterns(&self,
                           cx: &mut ExtCtxt,
-                          field_paths: ~[ast::Path],
+                          field_paths: Vec<ast::Path> ,
                           mutbl: ast::Mutability)
-                          -> ~[@ast::Pat] {
+                          -> Vec<@ast::Pat> {
         field_paths.map(|path| {
             cx.pat(path.span,
                         ast::PatIdent(ast::BindByRef(mutbl), (*path).clone(), None))
@@ -1035,18 +1039,18 @@ impl<'a> TraitDef<'a> {
                              struct_def: &StructDef,
                              prefix: &str,
                              mutbl: ast::Mutability)
-                             -> (@ast::Pat, ~[(Span, Option<Ident>, @Expr)]) {
+                             -> (@ast::Pat, Vec<(Span, Option<Ident>, @Expr)> ) {
         if struct_def.fields.is_empty() {
             return (
                 cx.pat_ident_binding_mode(
                     self.span, struct_ident, ast::BindByValue(ast::MutImmutable)),
-                ~[]);
+                Vec::new());
         }
 
-        let matching_path = cx.path(self.span, ~[ struct_ident ]);
+        let matching_path = cx.path(self.span, vec!( struct_ident ));
 
-        let mut paths = ~[];
-        let mut ident_expr = ~[];
+        let mut paths = Vec::new();
+        let mut ident_expr = Vec::new();
         let mut struct_type = Unknown;
 
         for (i, struct_field) in struct_def.fields.iter().enumerate() {
@@ -1096,20 +1100,20 @@ impl<'a> TraitDef<'a> {
                                    variant: &ast::Variant,
                                    prefix: &str,
                                    mutbl: ast::Mutability)
-        -> (@ast::Pat, ~[(Span, Option<Ident>, @Expr)]) {
+        -> (@ast::Pat, Vec<(Span, Option<Ident>, @Expr)> ) {
         let variant_ident = variant.node.name;
         match variant.node.kind {
             ast::TupleVariantKind(ref variant_args) => {
                 if variant_args.is_empty() {
                     return (cx.pat_ident_binding_mode(variant.span, variant_ident,
                                                           ast::BindByValue(ast::MutImmutable)),
-                            ~[]);
+                            Vec::new());
                 }
 
                 let matching_path = cx.path_ident(variant.span, variant_ident);
 
-                let mut paths = ~[];
-                let mut ident_expr = ~[];
+                let mut paths = Vec::new();
+                let mut ident_expr = Vec::new();
                 for (i, va) in variant_args.iter().enumerate() {
                     let sp = self.set_expn_info(cx, va.ty.span);
                     let path = cx.path_ident(sp, cx.ident_of(format!("{}_{}", prefix, i)));
@@ -1151,11 +1155,19 @@ pub fn cs_fold(use_foldl: bool,
         EnumMatching(_, _, ref all_fields) | Struct(ref all_fields) => {
             if use_foldl {
                 all_fields.iter().fold(base, |old, field| {
-                    f(cx, field.span, old, field.self_, field.other)
+                    f(cx,
+                      field.span,
+                      old,
+                      field.self_,
+                      field.other.as_slice())
                 })
             } else {
                 all_fields.rev_iter().fold(base, |old, field| {
-                    f(cx, field.span, old, field.self_, field.other)
+                    f(cx,
+                      field.span,
+                      old,
+                      field.self_,
+                      field.other.as_slice())
                 })
             }
         },
@@ -1179,7 +1191,7 @@ f(cx, span, ~[self_1.method(__arg_1_1, __arg_2_1),
 ~~~
 */
 #[inline]
-pub fn cs_same_method(f: |&mut ExtCtxt, Span, ~[@Expr]| -> @Expr,
+pub fn cs_same_method(f: |&mut ExtCtxt, Span, Vec<@Expr> | -> @Expr,
                       enum_nonmatch_f: EnumNonMatchFunc,
                       cx: &mut ExtCtxt,
                       trait_span: Span,
diff --git a/src/libsyntax/ext/deriving/hash.rs b/src/libsyntax/ext/deriving/hash.rs
index acae4f9efa6..1d6cfab120d 100644
--- a/src/libsyntax/ext/deriving/hash.rs
+++ b/src/libsyntax/ext/deriving/hash.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_hash(cx: &mut ExtCtxt,
                             span: Span,
                             mitem: @MetaItem,
@@ -22,23 +24,23 @@ pub fn expand_deriving_hash(cx: &mut ExtCtxt,
 
     let hash_trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "hash", "Hash"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "hash", "Hash")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "hash",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[Ptr(~Literal(Path::new(~["std", "hash", "sip", "SipState"])),
-                            Borrowed(None, MutMutable))],
+                args: vec!(Ptr(~Literal(Path::new(vec!("std", "hash", "sip", "SipState"))),
+                            Borrowed(None, MutMutable))),
                 ret_ty: nil_ty(),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: hash_substructure
             }
-        ]
+        )
     };
 
     hash_trait_def.expand(cx, mitem, item, push);
@@ -51,10 +53,10 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
     };
     let hash_ident = substr.method_ident;
     let call_hash = |span, thing_expr| {
-        let expr = cx.expr_method_call(span, thing_expr, hash_ident, ~[state_expr]);
+        let expr = cx.expr_method_call(span, thing_expr, hash_ident, vec!(state_expr));
         cx.stmt_expr(expr)
     };
-    let mut stmts = ~[];
+    let mut stmts = Vec::new();
 
     let fields = match *substr.fields {
         Struct(ref fs) => fs,
diff --git a/src/libsyntax/ext/deriving/primitive.rs b/src/libsyntax/ext/deriving/primitive.rs
index 03192cc1cd2..ecd042eb172 100644
--- a/src/libsyntax/ext/deriving/primitive.rs
+++ b/src/libsyntax/ext/deriving/primitive.rs
@@ -16,6 +16,8 @@ use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 use parse::token::InternedString;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
                                       span: Span,
                                       mitem: @MetaItem,
@@ -23,21 +25,20 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
                                       push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "num", "FromPrimitive"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "num", "FromPrimitive")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "from_i64",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[
-                    Literal(Path::new(~["i64"])),
-                ],
-                ret_ty: Literal(Path::new_(~["std", "option", "Option"],
+                args: vec!(
+                    Literal(Path::new(vec!("i64")))),
+                ret_ty: Literal(Path::new_(vec!("std", "option", "Option"),
                                            None,
-                                           ~[~Self],
+                                           vec!(~Self),
                                            true)),
                 // liable to cause code-bloat
                 inline: true,
@@ -48,19 +49,17 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
                 name: "from_u64",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[
-                    Literal(Path::new(~["u64"])),
-                ],
-                ret_ty: Literal(Path::new_(~["std", "option", "Option"],
+                args: vec!(
+                    Literal(Path::new(vec!("u64")))),
+                ret_ty: Literal(Path::new_(vec!("std", "option", "Option"),
                                            None,
-                                           ~[~Self],
+                                           vec!(~Self),
                                            true)),
                 // liable to cause code-bloat
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: |c, s, sub| cs_from("u64", c, s, sub),
-            },
-        ]
+            })
     };
 
     trait_def.expand(cx, mitem, item, push)
@@ -84,7 +83,7 @@ fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure
                 return cx.expr_fail(trait_span, InternedString::new(""));
             }
 
-            let mut arms = ~[];
+            let mut arms = Vec::new();
 
             for variant in enum_def.variants.iter() {
                 match variant.node.kind {
@@ -109,7 +108,7 @@ fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure
 
                         // arm for `_ if $guard => $body`
                         let arm = ast::Arm {
-                            pats: ~[cx.pat_wild(span)],
+                            pats: vec!(cx.pat_wild(span)),
                             guard: Some(guard),
                             body: cx.block_expr(body),
                         };
@@ -128,7 +127,7 @@ fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure
 
             // arm for `_ => None`
             let arm = ast::Arm {
-                pats: ~[cx.pat_wild(trait_span)],
+                pats: vec!(cx.pat_wild(trait_span)),
                 guard: None,
                 body: cx.block_expr(cx.expr_none(trait_span)),
             };
diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs
index 6efe4801592..da9679eb655 100644
--- a/src/libsyntax/ext/deriving/rand.rs
+++ b/src/libsyntax/ext/deriving/rand.rs
@@ -16,6 +16,8 @@ use ext::build::{AstBuilder};
 use ext::deriving::generic::*;
 use opt_vec;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_rand(cx: &mut ExtCtxt,
                             span: Span,
                             mitem: @MetaItem,
@@ -23,48 +25,48 @@ pub fn expand_deriving_rand(cx: &mut ExtCtxt,
                             push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "rand", "Rand"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "rand", "Rand")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "rand",
                 generics: LifetimeBounds {
-                    lifetimes: ~[],
-                    bounds: ~[("R",
-                               ~[ Path::new(~["std", "rand", "Rng"]) ])]
+                    lifetimes: Vec::new(),
+                    bounds: vec!(("R",
+                               vec!( Path::new(vec!("std", "rand", "Rng")) )))
                 },
                 explicit_self: None,
-                args: ~[
+                args: vec!(
                     Ptr(~Literal(Path::new_local("R")),
                         Borrowed(None, ast::MutMutable))
-                ],
+                ),
                 ret_ty: Self,
                 inline: false,
                 const_nonmatching: false,
                 combine_substructure: rand_substructure
             }
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
 
 fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
     let rng = match substr.nonself_args {
-        [rng] => ~[ rng ],
+        [rng] => vec!( rng ),
         _ => cx.bug("Incorrect number of arguments to `rand` in `deriving(Rand)`")
     };
-    let rand_ident = ~[
+    let rand_ident = vec!(
         cx.ident_of("std"),
         cx.ident_of("rand"),
         cx.ident_of("Rand"),
         cx.ident_of("rand")
-    ];
+    );
     let rand_call = |cx: &mut ExtCtxt, span| {
         cx.expr_call_global(span,
                             rand_ident.clone(),
-                            ~[ rng[0] ])
+                            vec!( *rng.get(0) ))
     };
 
     return match *substr.fields {
@@ -84,13 +86,13 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
                                         true,
                                         rand_ident.clone(),
                                         opt_vec::Empty,
-                                        ~[]);
+                                        Vec::new());
             let rand_name = cx.expr_path(rand_name);
 
             // ::std::rand::Rand::rand(rng)
             let rv_call = cx.expr_call(trait_span,
                                        rand_name,
-                                       ~[ rng[0] ]);
+                                       vec!( *rng.get(0) ));
 
             // need to specify the uint-ness of the random number
             let uint_ty = cx.ty_ident(trait_span, cx.ident_of("uint"));
@@ -113,15 +115,15 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
                 let pat = cx.pat_lit(v_span, i_expr);
 
                 let thing = rand_thing(cx, v_span, ident, summary, |cx, sp| rand_call(cx, sp));
-                cx.arm(v_span, ~[ pat ], thing)
-            }).collect::<~[ast::Arm]>();
+                cx.arm(v_span, vec!( pat ), thing)
+            }).collect::<Vec<ast::Arm> >();
 
             // _ => {} at the end. Should never occur
             arms.push(cx.arm_unreachable(trait_span));
 
             let match_expr = cx.expr_match(trait_span, rand_variant, arms);
 
-            let block = cx.block(trait_span, ~[ let_statement ], Some(match_expr));
+            let block = cx.block(trait_span, vec!( let_statement ), Some(match_expr));
             cx.expr_block(block)
         }
         _ => cx.bug("Non-static method in `deriving(Rand)`")
diff --git a/src/libsyntax/ext/deriving/show.rs b/src/libsyntax/ext/deriving/show.rs
index 4b9925c8d9f..51399d8efab 100644
--- a/src/libsyntax/ext/deriving/show.rs
+++ b/src/libsyntax/ext/deriving/show.rs
@@ -19,6 +19,7 @@ use ext::deriving::generic::*;
 use parse::token;
 
 use collections::HashMap;
+use std::vec_ng::Vec;
 
 pub fn expand_deriving_show(cx: &mut ExtCtxt,
                             span: Span,
@@ -26,27 +27,27 @@ pub fn expand_deriving_show(cx: &mut ExtCtxt,
                             item: @Item,
                             push: |@Item|) {
     // &mut ::std::fmt::Formatter
-    let fmtr = Ptr(~Literal(Path::new(~["std", "fmt", "Formatter"])),
+    let fmtr = Ptr(~Literal(Path::new(vec!("std", "fmt", "Formatter"))),
                    Borrowed(None, ast::MutMutable));
 
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "fmt", "Show"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "fmt", "Show")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "fmt",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[fmtr],
-                ret_ty: Literal(Path::new(~["std", "fmt", "Result"])),
+                args: vec!(fmtr),
+                ret_ty: Literal(Path::new(vec!("std", "fmt", "Result"))),
                 inline: false,
                 const_nonmatching: false,
                 combine_substructure: show_substructure
             }
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
@@ -70,7 +71,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
 
     let mut format_string = token::get_ident(name).get().to_owned();
     // the internal fields we're actually formatting
-    let mut exprs = ~[];
+    let mut exprs = Vec::new();
 
     // Getting harder... making the format string:
     match *substr.fields {
@@ -79,7 +80,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
         EnumMatching(_, _, ref fields) if fields.len() == 0 => {}
 
         Struct(ref fields) | EnumMatching(_, _, ref fields) => {
-            if fields[0].name.is_none() {
+            if fields.get(0).name.is_none() {
                 // tuple struct/"normal" variant
 
                 format_string.push_str("(");
@@ -124,10 +125,10 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
     let formatter = substr.nonself_args[0];
     let buf = cx.expr_field_access(span, formatter, cx.ident_of("buf"));
 
-    let std_write = ~[cx.ident_of("std"), cx.ident_of("fmt"), cx.ident_of("write")];
+    let std_write = vec!(cx.ident_of("std"), cx.ident_of("fmt"), cx.ident_of("write"));
     let args = cx.ident_of("__args");
-    let write_call = cx.expr_call_global(span, std_write, ~[buf, cx.expr_ident(span, args)]);
-    let format_closure = cx.lambda_expr(span, ~[args], write_call);
+    let write_call = cx.expr_call_global(span, std_write, vec!(buf, cx.expr_ident(span, args)));
+    let format_closure = cx.lambda_expr(span, vec!(args), write_call);
 
     let s = token::intern_and_get_ident(format_string);
     let format_string = cx.expr_str(span, s);
@@ -135,6 +136,6 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span,
     // phew, not our responsibility any more!
     format::expand_preparsed_format_args(cx, span,
                                          format_closure,
-                                         format_string, exprs, ~[],
+                                         format_string, exprs, Vec::new(),
                                          HashMap::new())
 }
diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs
index 1d3dd9185ca..b88cd117911 100644
--- a/src/libsyntax/ext/deriving/ty.rs
+++ b/src/libsyntax/ext/deriving/ty.rs
@@ -21,6 +21,8 @@ use codemap::{Span,respan};
 use opt_vec;
 use opt_vec::OptVec;
 
+use std::vec_ng::Vec;
+
 /// The types of pointers
 pub enum PtrTy<'a> {
     Send, // ~
@@ -30,22 +32,22 @@ pub enum PtrTy<'a> {
 /// A path, e.g. `::std::option::Option::<int>` (global). Has support
 /// for type parameters and a lifetime.
 pub struct Path<'a> {
-    path: ~[&'a str],
+    path: Vec<&'a str> ,
     lifetime: Option<&'a str>,
-    params: ~[~Ty<'a>],
+    params: Vec<~Ty<'a>> ,
     global: bool
 }
 
 impl<'a> Path<'a> {
-    pub fn new<'r>(path: ~[&'r str]) -> Path<'r> {
-        Path::new_(path, None, ~[], true)
+    pub fn new<'r>(path: Vec<&'r str> ) -> Path<'r> {
+        Path::new_(path, None, Vec::new(), true)
     }
     pub fn new_local<'r>(path: &'r str) -> Path<'r> {
-        Path::new_(~[ path ], None, ~[], false)
+        Path::new_(vec!( path ), None, Vec::new(), false)
     }
-    pub fn new_<'r>(path: ~[&'r str],
+    pub fn new_<'r>(path: Vec<&'r str> ,
                     lifetime: Option<&'r str>,
-                    params: ~[~Ty<'r>],
+                    params: Vec<~Ty<'r>> ,
                     global: bool)
                     -> Path<'r> {
         Path {
@@ -87,7 +89,7 @@ pub enum Ty<'a> {
     // parameter, and things like `int`
     Literal(Path<'a>),
     // includes nil
-    Tuple(~[Ty<'a>])
+    Tuple(Vec<Ty<'a>> )
 }
 
 pub fn borrowed_ptrty<'r>() -> PtrTy<'r> {
@@ -106,7 +108,7 @@ pub fn borrowed_self<'r>() -> Ty<'r> {
 }
 
 pub fn nil_ty() -> Ty<'static> {
-    Tuple(~[])
+    Tuple(Vec::new())
 }
 
 fn mk_lifetime(cx: &ExtCtxt, span: Span, lt: &Option<&str>) -> Option<ast::Lifetime> {
@@ -172,7 +174,7 @@ impl<'a> Ty<'a> {
                 });
                 let lifetimes = self_generics.lifetimes.clone();
 
-                cx.path_all(span, false, ~[self_ty], lifetimes,
+                cx.path_all(span, false, vec!(self_ty), lifetimes,
                             opt_vec::take_vec(self_params))
             }
             Literal(ref p) => {
@@ -188,14 +190,14 @@ impl<'a> Ty<'a> {
 fn mk_ty_param(cx: &ExtCtxt, span: Span, name: &str, bounds: &[Path],
                self_ident: Ident, self_generics: &Generics) -> ast::TyParam {
     let bounds = opt_vec::from(
-        bounds.map(|b| {
+        bounds.iter().map(|b| {
             let path = b.to_path(cx, span, self_ident, self_generics);
             cx.typarambound(path)
-        }));
+        }).collect());
     cx.typaram(cx.ident_of(name), bounds, None)
 }
 
-fn mk_generics(lifetimes: ~[ast::Lifetime],  ty_params: ~[ast::TyParam]) -> Generics {
+fn mk_generics(lifetimes: Vec<ast::Lifetime> ,  ty_params: Vec<ast::TyParam> ) -> Generics {
     Generics {
         lifetimes: opt_vec::from(lifetimes),
         ty_params: opt_vec::from(ty_params)
@@ -204,14 +206,14 @@ fn mk_generics(lifetimes: ~[ast::Lifetime],  ty_params: ~[ast::TyParam]) -> Gene
 
 /// Lifetimes and bounds on type parameters
 pub struct LifetimeBounds<'a> {
-    lifetimes: ~[&'a str],
-    bounds: ~[(&'a str, ~[Path<'a>])]
+    lifetimes: Vec<&'a str>,
+    bounds: Vec<(&'a str, Vec<Path<'a>>)>,
 }
 
 impl<'a> LifetimeBounds<'a> {
     pub fn empty() -> LifetimeBounds<'static> {
         LifetimeBounds {
-            lifetimes: ~[], bounds: ~[]
+            lifetimes: Vec::new(), bounds: Vec::new()
         }
     }
     pub fn to_generics(&self,
@@ -226,7 +228,12 @@ impl<'a> LifetimeBounds<'a> {
         let ty_params = self.bounds.map(|t| {
             match t {
                 &(ref name, ref bounds) => {
-                    mk_ty_param(cx, span, *name, *bounds, self_ty, self_generics)
+                    mk_ty_param(cx,
+                                span,
+                                *name,
+                                bounds.as_slice(),
+                                self_ty,
+                                self_generics)
                 }
             }
         });
diff --git a/src/libsyntax/ext/deriving/zero.rs b/src/libsyntax/ext/deriving/zero.rs
index 90f4fa0eb58..98c0ec9d072 100644
--- a/src/libsyntax/ext/deriving/zero.rs
+++ b/src/libsyntax/ext/deriving/zero.rs
@@ -14,6 +14,8 @@ use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
 
+use std::vec_ng::Vec;
+
 pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                             span: Span,
                             mitem: @MetaItem,
@@ -21,16 +23,16 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                             push: |@Item|) {
     let trait_def = TraitDef {
         span: span,
-        attributes: ~[],
-        path: Path::new(~["std", "num", "Zero"]),
-        additional_bounds: ~[],
+        attributes: Vec::new(),
+        path: Path::new(vec!("std", "num", "Zero")),
+        additional_bounds: Vec::new(),
         generics: LifetimeBounds::empty(),
-        methods: ~[
+        methods: vec!(
             MethodDef {
                 name: "zero",
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
-                args: ~[],
+                args: Vec::new(),
                 ret_ty: Self,
                 inline: true,
                 const_nonmatching: false,
@@ -40,8 +42,8 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                 name: "is_zero",
                 generics: LifetimeBounds::empty(),
                 explicit_self: borrowed_explicit_self(),
-                args: ~[],
-                ret_ty: Literal(Path::new(~["bool"])),
+                args: Vec::new(),
+                ret_ty: Literal(Path::new(vec!("bool"))),
                 inline: true,
                 const_nonmatching: false,
                 combine_substructure: |cx, span, substr| {
@@ -52,19 +54,19 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
                            cx, span, substr)
                 }
             }
-        ]
+        )
     };
     trait_def.expand(cx, mitem, item, push)
 }
 
 fn zero_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
-    let zero_ident = ~[
+    let zero_ident = vec!(
         cx.ident_of("std"),
         cx.ident_of("num"),
         cx.ident_of("Zero"),
         cx.ident_of("zero")
-    ];
-    let zero_call = |span| cx.expr_call_global(span, zero_ident.clone(), ~[]);
+    );
+    let zero_call = |span| cx.expr_call_global(span, zero_ident.clone(), Vec::new());
 
     return match *substr.fields {
         StaticStruct(_, ref summary) => {
diff --git a/src/libsyntax/ext/env.rs b/src/libsyntax/ext/env.rs
index aacb2a74087..b0b5fa26015 100644
--- a/src/libsyntax/ext/env.rs
+++ b/src/libsyntax/ext/env.rs
@@ -19,6 +19,7 @@ use codemap::Span;
 use ext::base::*;
 use ext::base;
 use ext::build::AstBuilder;
+use opt_vec;
 use parse::token;
 
 use std::os;
@@ -31,8 +32,30 @@ pub fn expand_option_env(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
     };
 
     let e = match os::getenv(var) {
-      None => quote_expr!(cx, ::std::option::None::<&'static str>),
-      Some(s) => quote_expr!(cx, ::std::option::Some($s))
+      None => {
+          cx.expr_path(cx.path_all(sp,
+                                   true,
+                                   vec!(cx.ident_of("std"),
+                                        cx.ident_of("option"),
+                                        cx.ident_of("None")),
+                                   opt_vec::Empty,
+                                   vec!(cx.ty_rptr(sp,
+                                                   cx.ty_ident(sp,
+                                                        cx.ident_of("str")),
+                                                   Some(cx.lifetime(sp,
+                                                        cx.ident_of(
+                                                            "static").name)),
+                                                   ast::MutImmutable))))
+      }
+      Some(s) => {
+          cx.expr_call_global(sp,
+                              vec!(cx.ident_of("std"),
+                                   cx.ident_of("option"),
+                                   cx.ident_of("Some")),
+                              vec!(cx.expr_str(sp,
+                                               token::intern_and_get_ident(
+                                          s))))
+      }
     };
     MRExpr(e)
 }
@@ -48,7 +71,9 @@ pub fn expand_env(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
         Some(exprs) => exprs
     };
 
-    let var = match expr_to_str(cx, exprs[0], "expected string literal") {
+    let var = match expr_to_str(cx,
+                                *exprs.get(0),
+                                "expected string literal") {
         None => return MacResult::dummy_expr(sp),
         Some((v, _style)) => v
     };
@@ -59,7 +84,7 @@ pub fn expand_env(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
                                                 var))
         }
         2 => {
-            match expr_to_str(cx, exprs[1], "expected string literal") {
+            match expr_to_str(cx, *exprs.get(1), "expected string literal") {
                 None => return MacResult::dummy_expr(sp),
                 Some((s, _style)) => s
             }
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index b49f9fb3a38..b162e17f53d 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -31,6 +31,7 @@ use util::small_vector::SmallVector;
 use std::cast;
 use std::unstable::dynamic_lib::DynamicLibrary;
 use std::os;
+use std::vec_ng::Vec;
 
 pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
     match e.node {
@@ -53,7 +54,7 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
                         // let compilation continue
                         return MacResult::raw_dummy_expr(e.span);
                     }
-                    let extname = pth.segments[0].identifier;
+                    let extname = pth.segments.get(0).identifier;
                     let extnamestr = token::get_ident(extname);
                     // leaving explicit deref here to highlight unbox op:
                     let marked_after = match fld.extsbox.find(&extname.name) {
@@ -77,7 +78,7 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
                             });
                             let fm = fresh_mark();
                             // mark before:
-                            let marked_before = mark_tts(*tts,fm);
+                            let marked_before = mark_tts(tts.as_slice(), fm);
 
                             // The span that we pass to the expanders we want to
                             // be the root of the call stack. That's the most
@@ -87,7 +88,7 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
 
                             let expanded = match expandfun.expand(fld.cx,
                                                    mac_span.call_site,
-                                                   marked_before) {
+                                                   marked_before.as_slice()) {
                                 MRExpr(e) => e,
                                 MRAny(any_macro) => any_macro.make_expr(),
                                 _ => {
@@ -169,21 +170,24 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
             let none_arm = {
                 let break_expr = fld.cx.expr(span, ast::ExprBreak(opt_ident));
                 let none_pat = fld.cx.pat_ident(span, none_ident);
-                fld.cx.arm(span, ~[none_pat], break_expr)
+                fld.cx.arm(span, vec!(none_pat), break_expr)
             };
 
             // `Some(<src_pat>) => <src_loop_block>`
             let some_arm =
                 fld.cx.arm(span,
-                           ~[fld.cx.pat_enum(span, some_path, ~[src_pat])],
+                           vec!(fld.cx.pat_enum(span, some_path, vec!(src_pat))),
                            fld.cx.expr_block(src_loop_block));
 
             // `match i.next() { ... }`
             let match_expr = {
                 let next_call_expr =
-                    fld.cx.expr_method_call(span, fld.cx.expr_path(local_path), next_ident, ~[]);
+                    fld.cx.expr_method_call(span,
+                                            fld.cx.expr_path(local_path),
+                                            next_ident,
+                                            Vec::new());
 
-                fld.cx.expr_match(span, next_call_expr, ~[none_arm, some_arm])
+                fld.cx.expr_match(span, next_call_expr, vec!(none_arm, some_arm))
             };
 
             // ['ident:] loop { ... }
@@ -196,8 +200,8 @@ pub fn expand_expr(e: @ast::Expr, fld: &mut MacroExpander) -> @ast::Expr {
             // `match &mut <src_expr> { i => loop { ... } }`
             let discrim = fld.cx.expr_mut_addr_of(span, src_expr);
             let i_pattern = fld.cx.pat_ident(span, local_ident);
-            let arm = fld.cx.arm(span, ~[i_pattern], loop_expr);
-            fld.cx.expr_match(span, discrim, ~[arm])
+            let arm = fld.cx.arm(span, vec!(i_pattern), loop_expr);
+            fld.cx.expr_match(span, discrim, vec!(arm))
         }
 
         ast::ExprLoop(loop_block, opt_ident) => {
@@ -221,7 +225,7 @@ fn rename_loop_label(opt_ident: Option<Ident>,
             let new_label = fresh_name(&label);
             let rename = (label, new_label);
             fld.extsbox.info().pending_renames.push(rename);
-            let mut pending_renames = ~[rename];
+            let mut pending_renames = vec!(rename);
             let mut rename_fld = renames_to_fold(&mut pending_renames);
             (Some(rename_fld.fold_ident(label)),
              rename_fld.fold_block(loop_block))
@@ -276,7 +280,7 @@ pub fn expand_item(it: @ast::Item, fld: &mut MacroExpander)
         ast::ItemMac(..) => expand_item_mac(it, fld),
         ast::ItemMod(_) | ast::ItemForeignMod(_) => {
             fld.cx.mod_push(it.ident);
-            let macro_escape = contains_macro_escape(it.attrs);
+            let macro_escape = contains_macro_escape(it.attrs.as_slice());
             let result = with_exts_frame!(fld.extsbox,
                                           macro_escape,
                                           noop_fold_item(it, fld));
@@ -309,7 +313,7 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
         _ => fld.cx.span_bug(it.span, "invalid item macro invocation")
     };
 
-    let extname = pth.segments[0].identifier;
+    let extname = pth.segments.get(0).identifier;
     let extnamestr = token::get_ident(extname);
     let fm = fresh_mark();
     let expanded = match fld.extsbox.find(&extname.name) {
@@ -339,8 +343,8 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
                 }
             });
             // mark before expansion:
-            let marked_before = mark_tts(tts,fm);
-            expander.expand(fld.cx, it.span, marked_before)
+            let marked_before = mark_tts(tts.as_slice(), fm);
+            expander.expand(fld.cx, it.span, marked_before.as_slice())
         }
         Some(&IdentTT(ref expander, span)) => {
             if it.ident.name == parse::token::special_idents::invalid.name {
@@ -358,7 +362,7 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
                 }
             });
             // mark before expansion:
-            let marked_tts = mark_tts(tts,fm);
+            let marked_tts = mark_tts(tts.as_slice(), fm);
             expander.expand(fld.cx, it.span, it.ident, marked_tts)
         }
         _ => {
@@ -391,7 +395,7 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
             // yikes... no idea how to apply the mark to this. I'm afraid
             // we're going to have to wait-and-see on this one.
             fld.extsbox.insert(intern(name), ext);
-            if attr::contains_name(it.attrs, "macro_export") {
+            if attr::contains_name(it.attrs.as_slice(), "macro_export") {
                 SmallVector::one(it)
             } else {
                 SmallVector::zero()
@@ -504,7 +508,7 @@ pub fn expand_stmt(s: &Stmt, fld: &mut MacroExpander) -> SmallVector<@Stmt> {
         fld.cx.span_err(pth.span, "expected macro name without module separators");
         return SmallVector::zero();
     }
-    let extname = pth.segments[0].identifier;
+    let extname = pth.segments.get(0).identifier;
     let extnamestr = token::get_ident(extname);
     let marked_after = match fld.extsbox.find(&extname.name) {
         None => {
@@ -523,7 +527,7 @@ pub fn expand_stmt(s: &Stmt, fld: &mut MacroExpander) -> SmallVector<@Stmt> {
             });
             let fm = fresh_mark();
             // mark before expansion:
-            let marked_tts = mark_tts(tts,fm);
+            let marked_tts = mark_tts(tts.as_slice(), fm);
 
             // See the comment in expand_expr for why we want the original span,
             // not the current mac.span.
@@ -531,7 +535,7 @@ pub fn expand_stmt(s: &Stmt, fld: &mut MacroExpander) -> SmallVector<@Stmt> {
 
             let expanded = match expandfun.expand(fld.cx,
                                                   mac_span.call_site,
-                                                  marked_tts) {
+                                                  marked_tts.as_slice()) {
                 MRExpr(e) => {
                     @codemap::Spanned {
                         node: StmtExpr(e, ast::DUMMY_NODE_ID),
@@ -607,10 +611,10 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
                     // oh dear heaven... this is going to include the enum
                     // names, as well... but that should be okay, as long as
                     // the new names are gensyms for the old ones.
-                    let mut name_finder = new_name_finder(~[]);
+                    let mut name_finder = new_name_finder(Vec::new());
                     name_finder.visit_pat(expanded_pat,());
                     // generate fresh names, push them to a new pending list
-                    let mut new_pending_renames = ~[];
+                    let mut new_pending_renames = Vec::new();
                     for ident in name_finder.ident_accumulator.iter() {
                         let new_name = fresh_name(ident);
                         new_pending_renames.push((*ident,new_name));
@@ -657,7 +661,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
 // array (passed in to the traversal)
 #[deriving(Clone)]
 struct NewNameFinderContext {
-    ident_accumulator: ~[ast::Ident],
+    ident_accumulator: Vec<ast::Ident> ,
 }
 
 impl Visitor<()> for NewNameFinderContext {
@@ -676,7 +680,8 @@ impl Visitor<()> for NewNameFinderContext {
                         span: _,
                         segments: ref segments
                     } if segments.len() == 1 => {
-                        self.ident_accumulator.push(segments[0].identifier)
+                        self.ident_accumulator.push(segments.get(0)
+                                                            .identifier)
                     }
                     // I believe these must be enums...
                     _ => ()
@@ -700,7 +705,7 @@ impl Visitor<()> for NewNameFinderContext {
 // return a visitor that extracts the pat_ident paths
 // from a given thingy and puts them in a mutable
 // array (passed in to the traversal)
-pub fn new_name_finder(idents: ~[ast::Ident]) -> NewNameFinderContext {
+pub fn new_name_finder(idents: Vec<ast::Ident> ) -> NewNameFinderContext {
     NewNameFinderContext {
         ident_accumulator: idents,
     }
@@ -843,7 +848,7 @@ impl Folder for Marker {
         let macro = match m.node {
             MacInvocTT(ref path, ref tts, ctxt) => {
                 MacInvocTT(self.fold_path(path),
-                           fold_tts(*tts, self),
+                           fold_tts(tts.as_slice(), self),
                            new_mark(self.mark, ctxt))
             }
         };
@@ -860,7 +865,7 @@ fn new_mark_folder(m: Mrk) -> Marker {
 }
 
 // apply a given mark to the given token trees. Used prior to expansion of a macro.
-fn mark_tts(tts: &[TokenTree], m: Mrk) -> ~[TokenTree] {
+fn mark_tts(tts: &[TokenTree], m: Mrk) -> Vec<TokenTree> {
     fold_tts(tts, &mut new_mark_folder(m))
 }
 
@@ -912,12 +917,14 @@ mod test {
     use visit;
     use visit::Visitor;
 
+    use std::vec_ng::Vec;
+
     // a visitor that extracts the paths
     // from a given thingy and puts them in a mutable
     // array (passed in to the traversal)
     #[deriving(Clone)]
     struct NewPathExprFinderContext {
-        path_accumulator: ~[ast::Path],
+        path_accumulator: Vec<ast::Path> ,
     }
 
     impl Visitor<()> for NewPathExprFinderContext {
@@ -941,7 +948,7 @@ mod test {
     // return a visitor that extracts the paths
     // from a given pattern and puts them in a mutable
     // array (passed in to the traversal)
-    pub fn new_path_finder(paths: ~[ast::Path]) -> NewPathExprFinderContext {
+    pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
         NewPathExprFinderContext {
             path_accumulator: paths
         }
@@ -954,7 +961,7 @@ mod test {
             fail!("lolwut")
         }
 
-        fn get_exported_macros(&mut self, _: ast::CrateNum) -> ~[~str] {
+        fn get_exported_macros(&mut self, _: ast::CrateNum) -> Vec<~str> {
             fail!("lolwut")
         }
 
@@ -975,7 +982,7 @@ mod test {
         let crate_ast = parse::parse_crate_from_source_str(
             ~"<test>",
             src,
-            ~[],sess);
+            Vec::new(),sess);
         // should fail:
         let mut loader = ErrLoader;
         expand_crate(sess,&mut loader,crate_ast);
@@ -990,7 +997,7 @@ mod test {
         let crate_ast = parse::parse_crate_from_source_str(
             ~"<test>",
             src,
-            ~[],sess);
+            Vec::new(),sess);
         // should fail:
         let mut loader = ErrLoader;
         expand_crate(sess,&mut loader,crate_ast);
@@ -1004,7 +1011,7 @@ mod test {
         let crate_ast = parse::parse_crate_from_source_str(
             ~"<test>",
             src,
-            ~[], sess);
+            Vec::new(), sess);
         // should fail:
         let mut loader = ErrLoader;
         expand_crate(sess, &mut loader, crate_ast);
@@ -1014,10 +1021,10 @@ mod test {
         let attr1 = make_dummy_attr ("foo");
         let attr2 = make_dummy_attr ("bar");
         let escape_attr = make_dummy_attr ("macro_escape");
-        let attrs1 = ~[attr1, escape_attr, attr2];
-        assert_eq!(contains_macro_escape (attrs1),true);
-        let attrs2 = ~[attr1,attr2];
-        assert_eq!(contains_macro_escape (attrs2),false);
+        let attrs1 = vec!(attr1, escape_attr, attr2);
+        assert_eq!(contains_macro_escape(attrs1.as_slice()),true);
+        let attrs2 = vec!(attr1,attr2);
+        assert_eq!(contains_macro_escape(attrs2.as_slice()),false);
     }
 
     // make a MetaWord outer attribute with the given name
@@ -1082,48 +1089,30 @@ mod test {
     // in principle, you might want to control this boolean on a per-varref basis,
     // but that would make things even harder to understand, and might not be
     // necessary for thorough testing.
-    type RenamingTest = (&'static str, ~[~[uint]], bool);
+    type RenamingTest = (&'static str, Vec<Vec<uint>>, bool);
 
     #[test]
     fn automatic_renaming () {
-        let tests: ~[RenamingTest] =
-            ~[// b & c should get new names throughout, in the expr too:
+        let tests: Vec<RenamingTest> =
+            vec!(// b & c should get new names throughout, in the expr too:
                 ("fn a() -> int { let b = 13; let c = b; b+c }",
-                 ~[~[0,1],~[2]], false),
+                 vec!(vec!(0,1),vec!(2)), false),
                 // both x's should be renamed (how is this causing a bug?)
                 ("fn main () {let x: int = 13;x;}",
-                 ~[~[0]], false),
+                 vec!(vec!(0)), false),
                 // the use of b after the + should be renamed, the other one not:
                 ("macro_rules! f (($x:ident) => (b + $x)) fn a() -> int { let b = 13; f!(b)}",
-                 ~[~[1]], false),
+                 vec!(vec!(1)), false),
                 // the b before the plus should not be renamed (requires marks)
                 ("macro_rules! f (($x:ident) => ({let b=9; ($x + b)})) fn a() -> int { f!(b)}",
-                 ~[~[1]], false),
+                 vec!(vec!(1)), false),
                 // the marks going in and out of letty should cancel, allowing that $x to
                 // capture the one following the semicolon.
                 // this was an awesome test case, and caught a *lot* of bugs.
                 ("macro_rules! letty(($x:ident) => (let $x = 15;))
                   macro_rules! user(($x:ident) => ({letty!($x); $x}))
                   fn main() -> int {user!(z)}",
-                 ~[~[0]], false),
-                // no longer a fixme #8062: this test exposes a *potential* bug; our system does
-                // not behave exactly like MTWT, but a conversation with Matthew Flatt
-                // suggests that this can only occur in the presence of local-expand, which
-                // we have no plans to support.
-                // ("fn main() {let hrcoo = 19; macro_rules! getx(()=>(hrcoo)); getx!();}",
-                // ~[~[0]], true)
-                // FIXME #6994: the next string exposes the bug referred to in issue 6994, so I'm
-                // commenting it out.
-                // the z flows into and out of two macros (g & f) along one path, and one
-                // (just g) along the other, so the result of the whole thing should
-                // be "let z_123 = 3; z_123"
-                //"macro_rules! g (($x:ident) =>
-                //   ({macro_rules! f(($y:ident)=>({let $y=3;$x}));f!($x)}))
-                //   fn a(){g!(z)}"
-                // create a really evil test case where a $x appears inside a binding of $x
-                // but *shouldnt* bind because it was inserted by a different macro....
-                // can't write this test case until we have macro-generating macros.
-            ];
+                 vec!(vec!(0)), false));
         for (idx,s) in tests.iter().enumerate() {
             run_renaming_test(s,idx);
         }
@@ -1137,20 +1126,20 @@ mod test {
         };
         let cr = expand_crate_str(teststr.to_owned());
         // find the bindings:
-        let mut name_finder = new_name_finder(~[]);
+        let mut name_finder = new_name_finder(Vec::new());
         visit::walk_crate(&mut name_finder,&cr,());
         let bindings = name_finder.ident_accumulator;
 
         // find the varrefs:
-        let mut path_finder = new_path_finder(~[]);
+        let mut path_finder = new_path_finder(Vec::new());
         visit::walk_crate(&mut path_finder,&cr,());
         let varrefs = path_finder.path_accumulator;
 
         // must be one check clause for each binding:
         assert_eq!(bindings.len(),bound_connections.len());
         for (binding_idx,shouldmatch) in bound_connections.iter().enumerate() {
-            let binding_name = mtwt_resolve(bindings[binding_idx]);
-            let binding_marks = mtwt_marksof(bindings[binding_idx].ctxt,invalid_name);
+            let binding_name = mtwt_resolve(*bindings.get(binding_idx));
+            let binding_marks = mtwt_marksof(bindings.get(binding_idx).ctxt,invalid_name);
             // shouldmatch can't name varrefs that don't exist:
             assert!((shouldmatch.len() == 0) ||
                     (varrefs.len() > *shouldmatch.iter().max().unwrap()));
@@ -1159,13 +1148,18 @@ mod test {
                     // it should be a path of length 1, and it should
                     // be free-identifier=? or bound-identifier=? to the given binding
                     assert_eq!(varref.segments.len(),1);
-                    let varref_name = mtwt_resolve(varref.segments[0].identifier);
-                    let varref_marks = mtwt_marksof(varref.segments[0].identifier.ctxt,
+                    let varref_name = mtwt_resolve(varref.segments
+                                                         .get(0)
+                                                         .identifier);
+                    let varref_marks = mtwt_marksof(varref.segments
+                                                          .get(0)
+                                                          .identifier
+                                                          .ctxt,
                                                     invalid_name);
                     if !(varref_name==binding_name) {
                         println!("uh oh, should match but doesn't:");
                         println!("varref: {:?}",varref);
-                        println!("binding: {:?}", bindings[binding_idx]);
+                        println!("binding: {:?}", *bindings.get(binding_idx));
                         ast_util::display_sctable(get_sctable());
                     }
                     assert_eq!(varref_name,binding_name);
@@ -1176,7 +1170,8 @@ mod test {
                     }
                 } else {
                     let fail = (varref.segments.len() == 1)
-                        && (mtwt_resolve(varref.segments[0].identifier) == binding_name);
+                        && (mtwt_resolve(varref.segments.get(0).identifier) ==
+                                         binding_name);
                     // temp debugging:
                     if fail {
                         println!("failure on test {}",test_idx);
@@ -1185,11 +1180,13 @@ mod test {
                         println!("uh oh, matches but shouldn't:");
                         println!("varref: {:?}",varref);
                         // good lord, you can't make a path with 0 segments, can you?
-                        let string = token::get_ident(varref.segments[0].identifier);
+                        let string = token::get_ident(varref.segments
+                                                            .get(0)
+                                                            .identifier);
                         println!("varref's first segment's uint: {}, and string: \"{}\"",
-                                 varref.segments[0].identifier.name,
+                                 varref.segments.get(0).identifier.name,
                                  string.get());
-                        println!("binding: {:?}", bindings[binding_idx]);
+                        println!("binding: {:?}", *bindings.get(binding_idx));
                         ast_util::display_sctable(get_sctable());
                     }
                     assert!(!fail);
@@ -1205,40 +1202,41 @@ foo_module!()
 ";
         let cr = expand_crate_str(crate_str);
         // find the xx binding
-        let mut name_finder = new_name_finder(~[]);
+        let mut name_finder = new_name_finder(Vec::new());
         visit::walk_crate(&mut name_finder, &cr, ());
         let bindings = name_finder.ident_accumulator;
 
-        let cxbinds: ~[&ast::Ident] =
+        let cxbinds: Vec<&ast::Ident> =
             bindings.iter().filter(|b| {
                 let ident = token::get_ident(**b);
                 let string = ident.get();
                 "xx" == string
             }).collect();
-        let cxbinds: &[&ast::Ident] = cxbinds;
+        let cxbinds: &[&ast::Ident] = cxbinds.as_slice();
         let cxbind = match cxbinds {
             [b] => b,
             _ => fail!("expected just one binding for ext_cx")
         };
         let resolved_binding = mtwt_resolve(*cxbind);
         // find all the xx varrefs:
-        let mut path_finder = new_path_finder(~[]);
+        let mut path_finder = new_path_finder(Vec::new());
         visit::walk_crate(&mut path_finder, &cr, ());
         let varrefs = path_finder.path_accumulator;
 
         // the xx binding should bind all of the xx varrefs:
         for (idx,v) in varrefs.iter().filter(|p| {
             p.segments.len() == 1
-            && "xx" == token::get_ident(p.segments[0].identifier).get()
+            && "xx" == token::get_ident(p.segments.get(0).identifier).get()
         }).enumerate() {
-            if mtwt_resolve(v.segments[0].identifier) != resolved_binding {
+            if mtwt_resolve(v.segments.get(0).identifier) !=
+                    resolved_binding {
                 println!("uh oh, xx binding didn't match xx varref:");
                 println!("this is xx varref \\# {:?}",idx);
                 println!("binding: {:?}",cxbind);
                 println!("resolves to: {:?}",resolved_binding);
-                println!("varref: {:?}",v.segments[0].identifier);
+                println!("varref: {:?}",v.segments.get(0).identifier);
                 println!("resolves to: {:?}",
-                         mtwt_resolve(v.segments[0].identifier));
+                         mtwt_resolve(v.segments.get(0).identifier));
                 let table = get_sctable();
                 println!("SC table:");
 
@@ -1249,17 +1247,18 @@ foo_module!()
                     }
                 }
             }
-            assert_eq!(mtwt_resolve(v.segments[0].identifier),resolved_binding);
+            assert_eq!(mtwt_resolve(v.segments.get(0).identifier),
+                       resolved_binding);
         };
     }
 
     #[test]
     fn pat_idents(){
         let pat = string_to_pat(~"(a,Foo{x:c @ (b,9),y:Bar(4,d)})");
-        let mut pat_idents = new_name_finder(~[]);
+        let mut pat_idents = new_name_finder(Vec::new());
         pat_idents.visit_pat(pat, ());
         assert_eq!(pat_idents.ident_accumulator,
-                   strs_to_idents(~["a","c","b","d"]));
+                   strs_to_idents(vec!("a","c","b","d")));
     }
 
 }
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index 2642ee00458..7752d885968 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -22,6 +22,7 @@ use rsparse = parse;
 use std::fmt::parse;
 use collections::{HashMap, HashSet};
 use std::vec;
+use std::vec_ng::Vec;
 
 #[deriving(Eq)]
 enum ArgumentType {
@@ -41,20 +42,20 @@ struct Context<'a> {
 
     // Parsed argument expressions and the types that we've found so far for
     // them.
-    args: ~[@ast::Expr],
-    arg_types: ~[Option<ArgumentType>],
+    args: Vec<@ast::Expr>,
+    arg_types: Vec<Option<ArgumentType>>,
     // Parsed named expressions and the types that we've found for them so far.
     // Note that we keep a side-array of the ordering of the named arguments
     // found to be sure that we can translate them in the same order that they
     // were declared in.
     names: HashMap<~str, @ast::Expr>,
     name_types: HashMap<~str, ArgumentType>,
-    name_ordering: ~[~str],
+    name_ordering: Vec<~str>,
 
     // Collection of the compiled `rt::Piece` structures
-    pieces: ~[@ast::Expr],
+    pieces: Vec<@ast::Expr> ,
     name_positions: HashMap<~str, uint>,
-    method_statics: ~[@ast::Item],
+    method_statics: Vec<@ast::Item> ,
 
     // Updated as arguments are consumed or methods are entered
     nest_level: uint,
@@ -70,16 +71,17 @@ struct Context<'a> {
 ///     Some((fmtstr, unnamed arguments, ordering of named arguments,
 ///           named arguments))
 fn parse_args(ecx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
-    -> (@ast::Expr, Option<(@ast::Expr, ~[@ast::Expr], ~[~str],
-                            HashMap<~str, @ast::Expr>)>)
-{
-    let mut args = ~[];
+    -> (@ast::Expr, Option<(@ast::Expr, Vec<@ast::Expr>, Vec<~str>,
+                            HashMap<~str, @ast::Expr>)>) {
+    let mut args = Vec::new();
     let mut names = HashMap::<~str, @ast::Expr>::new();
-    let mut order = ~[];
+    let mut order = Vec::new();
 
     let mut p = rsparse::new_parser_from_tts(ecx.parse_sess(),
                                              ecx.cfg(),
-                                             tts.to_owned());
+                                             tts.iter()
+                                                .map(|x| (*x).clone())
+                                                .collect());
     // Parse the leading function expression (maybe a block, maybe a path)
     let extra = p.parse_expr();
     if !p.eat(&token::COMMA) {
@@ -276,14 +278,14 @@ impl<'a> Context<'a> {
                     return;
                 }
                 {
-                    let arg_type = match self.arg_types[arg] {
-                        None => None,
-                        Some(ref x) => Some(x)
+                    let arg_type = match self.arg_types.get(arg) {
+                        &None => None,
+                        &Some(ref x) => Some(x)
                     };
-                    self.verify_same(self.args[arg].span, &ty, arg_type);
+                    self.verify_same(self.args.get(arg).span, &ty, arg_type);
                 }
-                if self.arg_types[arg].is_none() {
-                    self.arg_types[arg] = Some(ty);
+                if self.arg_types.get(arg).is_none() {
+                    *self.arg_types.get_mut(arg) = Some(ty);
                 }
             }
 
@@ -357,7 +359,7 @@ impl<'a> Context<'a> {
 
     /// These attributes are applied to all statics that this syntax extension
     /// will generate.
-    fn static_attrs(&self) -> ~[ast::Attribute] {
+    fn static_attrs(&self) -> Vec<ast::Attribute> {
         // Flag statics as `address_insignificant` so LLVM can merge duplicate
         // globals as much as possible (which we're generating a whole lot of).
         let unnamed = self.ecx
@@ -371,41 +373,41 @@ impl<'a> Context<'a> {
                                            InternedString::new("dead_code"));
         let allow_dead_code = self.ecx.meta_list(self.fmtsp,
                                                  InternedString::new("allow"),
-                                                 ~[dead_code]);
+                                                 vec!(dead_code));
         let allow_dead_code = self.ecx.attribute(self.fmtsp, allow_dead_code);
-        return ~[unnamed, allow_dead_code];
+        return vec!(unnamed, allow_dead_code);
     }
 
-    fn parsepath(&self, s: &str) -> ~[ast::Ident] {
-        ~[self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
-          self.ecx.ident_of("parse"), self.ecx.ident_of(s)]
+    fn parsepath(&self, s: &str) -> Vec<ast::Ident> {
+        vec!(self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
+          self.ecx.ident_of("parse"), self.ecx.ident_of(s))
     }
 
-    fn rtpath(&self, s: &str) -> ~[ast::Ident] {
-        ~[self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
-          self.ecx.ident_of("rt"), self.ecx.ident_of(s)]
+    fn rtpath(&self, s: &str) -> Vec<ast::Ident> {
+        vec!(self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
+          self.ecx.ident_of("rt"), self.ecx.ident_of(s))
     }
 
-    fn ctpath(&self, s: &str) -> ~[ast::Ident] {
-        ~[self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
-          self.ecx.ident_of("parse"), self.ecx.ident_of(s)]
+    fn ctpath(&self, s: &str) -> Vec<ast::Ident> {
+        vec!(self.ecx.ident_of("std"), self.ecx.ident_of("fmt"),
+          self.ecx.ident_of("parse"), self.ecx.ident_of(s))
     }
 
     fn none(&self) -> @ast::Expr {
-        let none = self.ecx.path_global(self.fmtsp, ~[
+        let none = self.ecx.path_global(self.fmtsp, vec!(
                 self.ecx.ident_of("std"),
                 self.ecx.ident_of("option"),
-                self.ecx.ident_of("None")]);
+                self.ecx.ident_of("None")));
         self.ecx.expr_path(none)
     }
 
     fn some(&self, e: @ast::Expr) -> @ast::Expr {
-        let p = self.ecx.path_global(self.fmtsp, ~[
+        let p = self.ecx.path_global(self.fmtsp, vec!(
                 self.ecx.ident_of("std"),
                 self.ecx.ident_of("option"),
-                self.ecx.ident_of("Some")]);
+                self.ecx.ident_of("Some")));
         let p = self.ecx.expr_path(p);
-        self.ecx.expr_call(self.fmtsp, p, ~[e])
+        self.ecx.expr_call(self.fmtsp, p, vec!(e))
     }
 
     fn trans_count(&self, c: parse::Count) -> @ast::Expr {
@@ -413,11 +415,11 @@ impl<'a> Context<'a> {
         match c {
             parse::CountIs(i) => {
                 self.ecx.expr_call_global(sp, self.rtpath("CountIs"),
-                                          ~[self.ecx.expr_uint(sp, i)])
+                                          vec!(self.ecx.expr_uint(sp, i)))
             }
             parse::CountIsParam(i) => {
                 self.ecx.expr_call_global(sp, self.rtpath("CountIsParam"),
-                                          ~[self.ecx.expr_uint(sp, i)])
+                                          vec!(self.ecx.expr_uint(sp, i)))
             }
             parse::CountImplied => {
                 let path = self.ecx.path_global(sp, self.rtpath("CountImplied"));
@@ -434,7 +436,7 @@ impl<'a> Context<'a> {
                 };
                 let i = i + self.args.len();
                 self.ecx.expr_call_global(sp, self.rtpath("CountIsParam"),
-                                          ~[self.ecx.expr_uint(sp, i)])
+                                          vec!(self.ecx.expr_uint(sp, i)))
             }
         }
     }
@@ -450,21 +452,19 @@ impl<'a> Context<'a> {
                         }).collect();
                         let s = token::intern_and_get_ident(arm.selector);
                         let selector = self.ecx.expr_str(sp, s);
-                        self.ecx.expr_struct(sp, p, ~[
+                        self.ecx.expr_struct(sp, p, vec!(
                                 self.ecx.field_imm(sp,
                                                    self.ecx.ident_of("selector"),
                                                    selector),
                                 self.ecx.field_imm(sp, self.ecx.ident_of("result"),
-                                                   self.ecx.expr_vec_slice(sp, result)),
-                                ])
+                                                   self.ecx.expr_vec_slice(sp, result))))
                     }).collect();
                 let default = default.iter().map(|p| {
                         self.trans_piece(p)
                     }).collect();
-                self.ecx.expr_call_global(sp, self.rtpath("Select"), ~[
+                self.ecx.expr_call_global(sp, self.rtpath("Select"), vec!(
                         self.ecx.expr_vec_slice(sp, arms),
-                        self.ecx.expr_vec_slice(sp, default),
-                        ])
+                        self.ecx.expr_vec_slice(sp, default)))
             }
             parse::Plural(offset, ref arms, ref default) => {
                 let offset = match offset {
@@ -487,23 +487,21 @@ impl<'a> Context<'a> {
                             }
                         };
                         let selector = self.ecx.expr_call_global(sp,
-                                                                 lr, ~[selarg]);
-                        self.ecx.expr_struct(sp, p, ~[
+                                                                 lr, vec!(selarg));
+                        self.ecx.expr_struct(sp, p, vec!(
                                 self.ecx.field_imm(sp,
                                                    self.ecx.ident_of("selector"),
                                                    selector),
                                 self.ecx.field_imm(sp, self.ecx.ident_of("result"),
-                                                   self.ecx.expr_vec_slice(sp, result)),
-                                ])
+                                                   self.ecx.expr_vec_slice(sp, result))))
                     }).collect();
                 let default = default.iter().map(|p| {
                         self.trans_piece(p)
                     }).collect();
-                self.ecx.expr_call_global(sp, self.rtpath("Plural"), ~[
+                self.ecx.expr_call_global(sp, self.rtpath("Plural"), vec!(
                         offset,
                         self.ecx.expr_vec_slice(sp, arms),
-                        self.ecx.expr_vec_slice(sp, default),
-                        ])
+                        self.ecx.expr_vec_slice(sp, default)))
             }
         };
         let life = self.ecx.lifetime(sp, self.ecx.ident_of("static").name);
@@ -512,7 +510,7 @@ impl<'a> Context<'a> {
                 true,
                 self.rtpath("Method"),
                 opt_vec::with(life),
-                ~[]
+                Vec::new()
                     ), None);
         let st = ast::ItemStatic(ty, ast::MutImmutable, method);
         let static_name = self.ecx.ident_of(format!("__STATIC_METHOD_{}",
@@ -530,13 +528,13 @@ impl<'a> Context<'a> {
                 let s = token::intern_and_get_ident(s);
                 self.ecx.expr_call_global(sp,
                                           self.rtpath("String"),
-                                          ~[
+                                          vec!(
                     self.ecx.expr_str(sp, s)
-                ])
+                ))
             }
             parse::CurrentArgument => {
                 let nil = self.ecx.expr_lit(sp, ast::LitNil);
-                self.ecx.expr_call_global(sp, self.rtpath("CurrentArgument"), ~[nil])
+                self.ecx.expr_call_global(sp, self.rtpath("CurrentArgument"), vec!(nil))
             }
             parse::Argument(ref arg) => {
                 // Translate the position
@@ -549,7 +547,7 @@ impl<'a> Context<'a> {
                     }
                     parse::ArgumentIs(i) => {
                         self.ecx.expr_call_global(sp, self.rtpath("ArgumentIs"),
-                                                  ~[self.ecx.expr_uint(sp, i)])
+                                                  vec!(self.ecx.expr_uint(sp, i)))
                     }
                     // Named arguments are converted to positional arguments at
                     // the end of the list of arguments
@@ -560,7 +558,7 @@ impl<'a> Context<'a> {
                         };
                         let i = i + self.args.len();
                         self.ecx.expr_call_global(sp, self.rtpath("ArgumentIs"),
-                                                  ~[self.ecx.expr_uint(sp, i)])
+                                                  vec!(self.ecx.expr_uint(sp, i)))
                     }
                 };
 
@@ -583,13 +581,12 @@ impl<'a> Context<'a> {
                 let prec = self.trans_count(arg.format.precision);
                 let width = self.trans_count(arg.format.width);
                 let path = self.ecx.path_global(sp, self.rtpath("FormatSpec"));
-                let fmt = self.ecx.expr_struct(sp, path, ~[
+                let fmt = self.ecx.expr_struct(sp, path, vec!(
                     self.ecx.field_imm(sp, self.ecx.ident_of("fill"), fill),
                     self.ecx.field_imm(sp, self.ecx.ident_of("align"), align),
                     self.ecx.field_imm(sp, self.ecx.ident_of("flags"), flags),
                     self.ecx.field_imm(sp, self.ecx.ident_of("precision"), prec),
-                    self.ecx.field_imm(sp, self.ecx.ident_of("width"), width),
-                ]);
+                    self.ecx.field_imm(sp, self.ecx.ident_of("width"), width)));
 
                 // Translate the method (if any)
                 let method = match arg.method {
@@ -600,12 +597,11 @@ impl<'a> Context<'a> {
                     }
                 };
                 let path = self.ecx.path_global(sp, self.rtpath("Argument"));
-                let s = self.ecx.expr_struct(sp, path, ~[
+                let s = self.ecx.expr_struct(sp, path, vec!(
                     self.ecx.field_imm(sp, self.ecx.ident_of("position"), pos),
                     self.ecx.field_imm(sp, self.ecx.ident_of("format"), fmt),
-                    self.ecx.field_imm(sp, self.ecx.ident_of("method"), method),
-                ]);
-                self.ecx.expr_call_global(sp, self.rtpath("Argument"), ~[s])
+                    self.ecx.field_imm(sp, self.ecx.ident_of("method"), method)));
+                self.ecx.expr_call_global(sp, self.rtpath("Argument"), vec!(s))
             }
         }
     }
@@ -613,11 +609,11 @@ impl<'a> Context<'a> {
     /// Actually builds the expression which the iformat! block will be expanded
     /// to
     fn to_expr(&self, extra: @ast::Expr) -> @ast::Expr {
-        let mut lets = ~[];
-        let mut locals = ~[];
+        let mut lets = Vec::new();
+        let mut locals = Vec::new();
         let mut names = vec::from_fn(self.name_positions.len(), |_| None);
-        let mut pats = ~[];
-        let mut heads = ~[];
+        let mut pats = Vec::new();
+        let mut heads = Vec::new();
 
         // First, declare all of our methods that are statics
         for &method in self.method_statics.iter() {
@@ -631,15 +627,14 @@ impl<'a> Context<'a> {
         let fmt = self.ecx.expr_vec(self.fmtsp, self.pieces.clone());
         let piece_ty = self.ecx.ty_path(self.ecx.path_all(
                 self.fmtsp,
-                true, ~[
+                true, vec!(
                     self.ecx.ident_of("std"),
                     self.ecx.ident_of("fmt"),
                     self.ecx.ident_of("rt"),
-                    self.ecx.ident_of("Piece"),
-                ],
+                    self.ecx.ident_of("Piece")),
                 opt_vec::with(
                     self.ecx.lifetime(self.fmtsp, self.ecx.ident_of("static").name)),
-                ~[]
+                Vec::new()
             ), None);
         let ty = ast::TyFixedLengthVec(
             piece_ty,
@@ -661,7 +656,9 @@ impl<'a> Context<'a> {
         // of each variable because we don't want to move out of the arguments
         // passed to this function.
         for (i, &e) in self.args.iter().enumerate() {
-            if self.arg_types[i].is_none() { continue } // error already generated
+            if self.arg_types.get(i).is_none() {
+                continue // error already generated
+            }
 
             let name = self.ecx.ident_of(format!("__arg{}", i));
             pats.push(self.ecx.pat_ident(e.span, name));
@@ -696,18 +693,17 @@ impl<'a> Context<'a> {
         // Now create the fmt::Arguments struct with all our locals we created.
         let fmt = self.ecx.expr_ident(self.fmtsp, static_name);
         let args_slice = self.ecx.expr_ident(self.fmtsp, slicename);
-        let result = self.ecx.expr_call_global(self.fmtsp, ~[
+        let result = self.ecx.expr_call_global(self.fmtsp, vec!(
                 self.ecx.ident_of("std"),
                 self.ecx.ident_of("fmt"),
                 self.ecx.ident_of("Arguments"),
-                self.ecx.ident_of("new"),
-            ], ~[fmt, args_slice]);
+                self.ecx.ident_of("new")), vec!(fmt, args_slice));
 
         // We did all the work of making sure that the arguments
         // structure is safe, so we can safely have an unsafe block.
         let result = self.ecx.expr_block(P(ast::Block {
-           view_items: ~[],
-           stmts: ~[],
+           view_items: Vec::new(),
+           stmts: Vec::new(),
            expr: Some(result),
            id: ast::DUMMY_NODE_ID,
            rules: ast::UnsafeBlock(ast::CompilerGenerated),
@@ -716,8 +712,8 @@ impl<'a> Context<'a> {
         let resname = self.ecx.ident_of("__args");
         lets.push(self.ecx.stmt_let(self.fmtsp, false, resname, result));
         let res = self.ecx.expr_ident(self.fmtsp, resname);
-        let result = self.ecx.expr_call(extra.span, extra, ~[
-                            self.ecx.expr_addr_of(extra.span, res)]);
+        let result = self.ecx.expr_call(extra.span, extra, vec!(
+                            self.ecx.expr_addr_of(extra.span, res)));
         let body = self.ecx.expr_block(self.ecx.block(self.fmtsp, lets,
                                                       Some(result)));
 
@@ -749,15 +745,15 @@ impl<'a> Context<'a> {
         // But the nested match expression is proved to perform not as well
         // as series of let's; the first approach does.
         let pat = self.ecx.pat(self.fmtsp, ast::PatTup(pats));
-        let arm = self.ecx.arm(self.fmtsp, ~[pat], body);
+        let arm = self.ecx.arm(self.fmtsp, vec!(pat), body);
         let head = self.ecx.expr(self.fmtsp, ast::ExprTup(heads));
-        self.ecx.expr_match(self.fmtsp, head, ~[arm])
+        self.ecx.expr_match(self.fmtsp, head, vec!(arm))
     }
 
     fn format_arg(&self, sp: Span, argno: Position, arg: @ast::Expr)
                   -> @ast::Expr {
         let ty = match argno {
-            Exact(ref i) => self.arg_types[*i].get_ref(),
+            Exact(ref i) => self.arg_types.get(*i).get_ref(),
             Named(ref s) => self.name_types.get(s)
         };
 
@@ -787,31 +783,27 @@ impl<'a> Context<'a> {
                 }
             }
             String => {
-                return self.ecx.expr_call_global(sp, ~[
+                return self.ecx.expr_call_global(sp, vec!(
                         self.ecx.ident_of("std"),
                         self.ecx.ident_of("fmt"),
-                        self.ecx.ident_of("argumentstr"),
-                    ], ~[arg])
+                        self.ecx.ident_of("argumentstr")), vec!(arg))
             }
             Unsigned => {
-                return self.ecx.expr_call_global(sp, ~[
+                return self.ecx.expr_call_global(sp, vec!(
                         self.ecx.ident_of("std"),
                         self.ecx.ident_of("fmt"),
-                        self.ecx.ident_of("argumentuint"),
-                    ], ~[arg])
+                        self.ecx.ident_of("argumentuint")), vec!(arg))
             }
         };
 
-        let format_fn = self.ecx.path_global(sp, ~[
+        let format_fn = self.ecx.path_global(sp, vec!(
                 self.ecx.ident_of("std"),
                 self.ecx.ident_of("fmt"),
-                self.ecx.ident_of(fmt_fn),
-            ]);
-        self.ecx.expr_call_global(sp, ~[
+                self.ecx.ident_of(fmt_fn)));
+        self.ecx.expr_call_global(sp, vec!(
                 self.ecx.ident_of("std"),
                 self.ecx.ident_of("fmt"),
-                self.ecx.ident_of("argument"),
-            ], ~[self.ecx.expr_path(format_fn), arg])
+                self.ecx.ident_of("argument")), vec!(self.ecx.expr_path(format_fn), arg))
     }
 }
 
@@ -832,10 +824,10 @@ pub fn expand_args(ecx: &mut ExtCtxt, sp: Span,
 /// expression.
 pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
                                     extra: @ast::Expr,
-                                    efmt: @ast::Expr, args: ~[@ast::Expr],
-                                    name_ordering: ~[~str],
+                                    efmt: @ast::Expr, args: Vec<@ast::Expr>,
+                                    name_ordering: Vec<~str>,
                                     names: HashMap<~str, @ast::Expr>) -> @ast::Expr {
-    let arg_types = vec::from_fn(args.len(), |_| None);
+    let arg_types = Vec::from_fn(args.len(), |_| None);
     let mut cx = Context {
         ecx: ecx,
         args: args,
@@ -846,8 +838,8 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
         name_ordering: name_ordering,
         nest_level: 0,
         next_arg: 0,
-        pieces: ~[],
-        method_statics: ~[],
+        pieces: Vec::new(),
+        method_statics: Vec::new(),
         fmtsp: sp,
     };
     cx.fmtsp = efmt.span;
@@ -884,7 +876,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
     // Make sure that all arguments were used and all arguments have types.
     for (i, ty) in cx.arg_types.iter().enumerate() {
         if ty.is_none() {
-            cx.ecx.span_err(cx.args[i].span, "argument never used");
+            cx.ecx.span_err(cx.args.get(i).span, "argument never used");
         }
     }
     for (name, e) in cx.names.iter() {
diff --git a/src/libsyntax/ext/log_syntax.rs b/src/libsyntax/ext/log_syntax.rs
index 5ee4084d207..b94928238e9 100644
--- a/src/libsyntax/ext/log_syntax.rs
+++ b/src/libsyntax/ext/log_syntax.rs
@@ -20,7 +20,8 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt,
                       -> base::MacResult {
 
     cx.print_backtrace();
-    println!("{}", print::pprust::tt_to_str(&ast::TTDelim(@tt.to_owned())));
+    println!("{}", print::pprust::tt_to_str(&ast::TTDelim(
+                @tt.iter().map(|x| (*x).clone()).collect())));
 
     //trivial expression
     MRExpr(@ast::Expr {
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index 35a5cbd235a..e96597d4159 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -17,6 +17,8 @@ use parse::token::*;
 use parse::token;
 use parse;
 
+use std::vec_ng::Vec;
+
 /**
 *
 * Quasiquoting works via token trees.
@@ -35,17 +37,19 @@ pub mod rt {
     use parse;
     use print::pprust;
 
+    use std::vec_ng::Vec;
+
     pub use ast::*;
     pub use parse::token::*;
     pub use parse::new_parser_from_tts;
     pub use codemap::{BytePos, Span, dummy_spanned};
 
     pub trait ToTokens {
-        fn to_tokens(&self, _cx: &ExtCtxt) -> ~[TokenTree];
+        fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> ;
     }
 
-    impl ToTokens for ~[TokenTree] {
-        fn to_tokens(&self, _cx: &ExtCtxt) -> ~[TokenTree] {
+    impl ToTokens for Vec<TokenTree> {
+        fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
             (*self).clone()
         }
     }
@@ -201,7 +205,7 @@ pub mod rt {
     macro_rules! impl_to_tokens(
         ($t:ty) => (
             impl ToTokens for $t {
-                fn to_tokens(&self, cx: &ExtCtxt) -> ~[TokenTree] {
+                fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {
                     cx.parse_tts(self.to_source())
                 }
             }
@@ -211,7 +215,7 @@ pub mod rt {
     macro_rules! impl_to_tokens_self(
         ($t:ty) => (
             impl<'a> ToTokens for $t {
-                fn to_tokens(&self, cx: &ExtCtxt) -> ~[TokenTree] {
+                fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {
                     cx.parse_tts(self.to_source())
                 }
             }
@@ -242,7 +246,7 @@ pub mod rt {
         fn parse_item(&self, s: ~str) -> @ast::Item;
         fn parse_expr(&self, s: ~str) -> @ast::Expr;
         fn parse_stmt(&self, s: ~str) -> @ast::Stmt;
-        fn parse_tts(&self, s: ~str) -> ~[ast::TokenTree];
+        fn parse_tts(&self, s: ~str) -> Vec<ast::TokenTree> ;
     }
 
     impl<'a> ExtParseUtils for ExtCtxt<'a> {
@@ -266,7 +270,7 @@ pub mod rt {
             parse::parse_stmt_from_source_str("<quote expansion>".to_str(),
                                               s,
                                               self.cfg(),
-                                              ~[],
+                                              Vec::new(),
                                               self.parse_sess())
         }
 
@@ -277,7 +281,7 @@ pub mod rt {
                                               self.parse_sess())
         }
 
-        fn parse_tts(&self, s: ~str) -> ~[ast::TokenTree] {
+        fn parse_tts(&self, s: ~str) -> Vec<ast::TokenTree> {
             parse::parse_tts_from_source_str("<quote expansion>".to_str(),
                                              s,
                                              self.cfg(),
@@ -298,16 +302,16 @@ pub fn expand_quote_tokens(cx: &mut ExtCtxt,
 pub fn expand_quote_expr(cx: &mut ExtCtxt,
                          sp: Span,
                          tts: &[ast::TokenTree]) -> base::MacResult {
-    let expanded = expand_parse_call(cx, sp, "parse_expr", ~[], tts);
+    let expanded = expand_parse_call(cx, sp, "parse_expr", Vec::new(), tts);
     base::MRExpr(expanded)
 }
 
 pub fn expand_quote_item(cx: &mut ExtCtxt,
                          sp: Span,
                          tts: &[ast::TokenTree]) -> base::MacResult {
-    let e_attrs = cx.expr_vec_uniq(sp, ~[]);
+    let e_attrs = cx.expr_vec_ng(sp);
     let expanded = expand_parse_call(cx, sp, "parse_item",
-                                    ~[e_attrs], tts);
+                                    vec!(e_attrs), tts);
     base::MRExpr(expanded)
 }
 
@@ -316,7 +320,7 @@ pub fn expand_quote_pat(cx: &mut ExtCtxt,
                         tts: &[ast::TokenTree]) -> base::MacResult {
     let e_refutable = cx.expr_lit(sp, ast::LitBool(true));
     let expanded = expand_parse_call(cx, sp, "parse_pat",
-                                    ~[e_refutable], tts);
+                                    vec!(e_refutable), tts);
     base::MRExpr(expanded)
 }
 
@@ -325,20 +329,20 @@ pub fn expand_quote_ty(cx: &mut ExtCtxt,
                        tts: &[ast::TokenTree]) -> base::MacResult {
     let e_param_colons = cx.expr_lit(sp, ast::LitBool(false));
     let expanded = expand_parse_call(cx, sp, "parse_ty",
-                                     ~[e_param_colons], tts);
+                                     vec!(e_param_colons), tts);
     base::MRExpr(expanded)
 }
 
 pub fn expand_quote_stmt(cx: &mut ExtCtxt,
                          sp: Span,
                          tts: &[ast::TokenTree]) -> base::MacResult {
-    let e_attrs = cx.expr_vec_uniq(sp, ~[]);
+    let e_attrs = cx.expr_vec_ng(sp);
     let expanded = expand_parse_call(cx, sp, "parse_stmt",
-                                    ~[e_attrs], tts);
+                                    vec!(e_attrs), tts);
     base::MRExpr(expanded)
 }
 
-fn ids_ext(strs: ~[~str]) -> ~[ast::Ident] {
+fn ids_ext(strs: Vec<~str> ) -> Vec<ast::Ident> {
     strs.map(|str| str_to_ident(*str))
 }
 
@@ -352,7 +356,7 @@ fn mk_ident(cx: &ExtCtxt, sp: Span, ident: ast::Ident) -> @ast::Expr {
     cx.expr_method_call(sp,
                         cx.expr_ident(sp, id_ext("ext_cx")),
                         id_ext("ident_of"),
-                        ~[e_str])
+                        vec!(e_str))
 }
 
 fn mk_binop(cx: &ExtCtxt, sp: Span, bop: token::BinOp) -> @ast::Expr {
@@ -377,18 +381,18 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
         BINOP(binop) => {
             return cx.expr_call_ident(sp,
                                       id_ext("BINOP"),
-                                      ~[mk_binop(cx, sp, binop)]);
+                                      vec!(mk_binop(cx, sp, binop)));
         }
         BINOPEQ(binop) => {
             return cx.expr_call_ident(sp,
                                       id_ext("BINOPEQ"),
-                                      ~[mk_binop(cx, sp, binop)]);
+                                      vec!(mk_binop(cx, sp, binop)));
         }
 
         LIT_CHAR(i) => {
             let e_char = cx.expr_lit(sp, ast::LitChar(i));
 
-            return cx.expr_call_ident(sp, id_ext("LIT_CHAR"), ~[e_char]);
+            return cx.expr_call_ident(sp, id_ext("LIT_CHAR"), vec!(e_char));
         }
 
         LIT_INT(i, ity) => {
@@ -405,7 +409,7 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_INT"),
-                                      ~[e_i64, e_ity]);
+                                      vec!(e_i64, e_ity));
         }
 
         LIT_UINT(u, uty) => {
@@ -422,7 +426,7 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_UINT"),
-                                      ~[e_u64, e_uty]);
+                                      vec!(e_u64, e_uty));
         }
 
         LIT_INT_UNSUFFIXED(i) => {
@@ -430,7 +434,7 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_INT_UNSUFFIXED"),
-                                      ~[e_i64]);
+                                      vec!(e_i64));
         }
 
         LIT_FLOAT(fident, fty) => {
@@ -444,39 +448,39 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_FLOAT"),
-                                      ~[e_fident, e_fty]);
+                                      vec!(e_fident, e_fty));
         }
 
         LIT_STR(ident) => {
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_STR"),
-                                      ~[mk_ident(cx, sp, ident)]);
+                                      vec!(mk_ident(cx, sp, ident)));
         }
 
         LIT_STR_RAW(ident, n) => {
             return cx.expr_call_ident(sp,
                                       id_ext("LIT_STR_RAW"),
-                                      ~[mk_ident(cx, sp, ident),
-                                        cx.expr_uint(sp, n)]);
+                                      vec!(mk_ident(cx, sp, ident),
+                                        cx.expr_uint(sp, n)));
         }
 
         IDENT(ident, b) => {
             return cx.expr_call_ident(sp,
                                       id_ext("IDENT"),
-                                      ~[mk_ident(cx, sp, ident),
-                                        cx.expr_bool(sp, b)]);
+                                      vec!(mk_ident(cx, sp, ident),
+                                        cx.expr_bool(sp, b)));
         }
 
         LIFETIME(ident) => {
             return cx.expr_call_ident(sp,
                                       id_ext("LIFETIME"),
-                                      ~[mk_ident(cx, sp, ident)]);
+                                      vec!(mk_ident(cx, sp, ident)));
         }
 
         DOC_COMMENT(ident) => {
             return cx.expr_call_ident(sp,
                                       id_ext("DOC_COMMENT"),
-                                      ~[mk_ident(cx, sp, ident)]);
+                                      vec!(mk_ident(cx, sp, ident)));
         }
 
         INTERPOLATED(_) => fail!("quote! with interpolated token"),
@@ -523,7 +527,7 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
 }
 
 
-fn mk_tt(cx: &ExtCtxt, sp: Span, tt: &ast::TokenTree) -> ~[@ast::Stmt] {
+fn mk_tt(cx: &ExtCtxt, sp: Span, tt: &ast::TokenTree) -> Vec<@ast::Stmt> {
 
     match *tt {
 
@@ -531,16 +535,16 @@ fn mk_tt(cx: &ExtCtxt, sp: Span, tt: &ast::TokenTree) -> ~[@ast::Stmt] {
             let e_sp = cx.expr_ident(sp, id_ext("_sp"));
             let e_tok = cx.expr_call_ident(sp,
                                            id_ext("TTTok"),
-                                           ~[e_sp, mk_token(cx, sp, tok)]);
+                                           vec!(e_sp, mk_token(cx, sp, tok)));
             let e_push =
                 cx.expr_method_call(sp,
                                     cx.expr_ident(sp, id_ext("tt")),
                                     id_ext("push"),
-                                    ~[e_tok]);
-            ~[cx.stmt_expr(e_push)]
+                                    vec!(e_tok));
+            vec!(cx.stmt_expr(e_push))
         }
 
-        ast::TTDelim(ref tts) => mk_tts(cx, sp, **tts),
+        ast::TTDelim(ref tts) => mk_tts(cx, sp, tts.as_slice()),
         ast::TTSeq(..) => fail!("TTSeq in quote!"),
 
         ast::TTNonterminal(sp, ident) => {
@@ -551,22 +555,22 @@ fn mk_tt(cx: &ExtCtxt, sp: Span, tt: &ast::TokenTree) -> ~[@ast::Stmt] {
                 cx.expr_method_call(sp,
                                     cx.expr_ident(sp, ident),
                                     id_ext("to_tokens"),
-                                    ~[cx.expr_ident(sp, id_ext("ext_cx"))]);
+                                    vec!(cx.expr_ident(sp, id_ext("ext_cx"))));
 
             let e_push =
                 cx.expr_method_call(sp,
                                     cx.expr_ident(sp, id_ext("tt")),
                                     id_ext("push_all_move"),
-                                    ~[e_to_toks]);
+                                    vec!(e_to_toks));
 
-            ~[cx.stmt_expr(e_push)]
+            vec!(cx.stmt_expr(e_push))
         }
     }
 }
 
 fn mk_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
-    -> ~[@ast::Stmt] {
-    let mut ss = ~[];
+    -> Vec<@ast::Stmt> {
+    let mut ss = Vec::new();
     for tt in tts.iter() {
         ss.push_all_move(mk_tt(cx, sp, tt));
     }
@@ -583,7 +587,9 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
 
     let mut p = parse::new_parser_from_tts(cx.parse_sess(),
                                            cx.cfg(),
-                                           tts.to_owned());
+                                           tts.iter()
+                                              .map(|x| (*x).clone())
+                                              .collect());
     p.quote_depth += 1u;
 
     let cx_expr = p.parse_expr();
@@ -623,20 +629,20 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
     let e_sp = cx.expr_method_call(sp,
                                    cx.expr_ident(sp, id_ext("ext_cx")),
                                    id_ext("call_site"),
-                                   ~[]);
+                                   Vec::new());
 
     let stmt_let_sp = cx.stmt_let(sp, false,
                                   id_ext("_sp"),
                                   e_sp);
 
-    let stmt_let_tt = cx.stmt_let(sp, true,
-                                  id_ext("tt"),
-                                  cx.expr_vec_uniq(sp, ~[]));
+    let stmt_let_tt = cx.stmt_let(sp, true, id_ext("tt"), cx.expr_vec_ng(sp));
 
+    let mut vector = vec!(stmt_let_sp, stmt_let_tt);
+    vector.push_all_move(mk_tts(cx, sp, tts.as_slice()));
     let block = cx.expr_block(
         cx.block_all(sp,
-                     ~[],
-                     ~[stmt_let_sp, stmt_let_tt] + mk_tts(cx, sp, tts),
+                     Vec::new(),
+                     vector,
                      Some(cx.expr_ident(sp, id_ext("tt")))));
 
     (cx_expr, block)
@@ -646,36 +652,36 @@ fn expand_wrapper(cx: &ExtCtxt,
                   sp: Span,
                   cx_expr: @ast::Expr,
                   expr: @ast::Expr) -> @ast::Expr {
-    let uses = ~[ cx.view_use_glob(sp, ast::Inherited,
-                                   ids_ext(~[~"syntax",
+    let uses = vec!( cx.view_use_glob(sp, ast::Inherited,
+                                   ids_ext(vec!(~"syntax",
                                              ~"ext",
                                              ~"quote",
-                                             ~"rt"])) ];
+                                             ~"rt"))) );
 
     let stmt_let_ext_cx = cx.stmt_let(sp, false, id_ext("ext_cx"), cx_expr);
 
-    cx.expr_block(cx.block_all(sp, uses, ~[stmt_let_ext_cx], Some(expr)))
+    cx.expr_block(cx.block_all(sp, uses, vec!(stmt_let_ext_cx), Some(expr)))
 }
 
 fn expand_parse_call(cx: &ExtCtxt,
                      sp: Span,
                      parse_method: &str,
-                     arg_exprs: ~[@ast::Expr],
+                     arg_exprs: Vec<@ast::Expr> ,
                      tts: &[ast::TokenTree]) -> @ast::Expr {
     let (cx_expr, tts_expr) = expand_tts(cx, sp, tts);
 
     let cfg_call = || cx.expr_method_call(
         sp, cx.expr_ident(sp, id_ext("ext_cx")),
-        id_ext("cfg"), ~[]);
+        id_ext("cfg"), Vec::new());
 
     let parse_sess_call = || cx.expr_method_call(
         sp, cx.expr_ident(sp, id_ext("ext_cx")),
-        id_ext("parse_sess"), ~[]);
+        id_ext("parse_sess"), Vec::new());
 
     let new_parser_call =
         cx.expr_call(sp,
                      cx.expr_ident(sp, id_ext("new_parser_from_tts")),
-                     ~[parse_sess_call(), cfg_call(), tts_expr]);
+                     vec!(parse_sess_call(), cfg_call(), tts_expr));
 
     let expr = cx.expr_method_call(sp, new_parser_call, id_ext(parse_method),
                                    arg_exprs);
diff --git a/src/libsyntax/ext/registrar.rs b/src/libsyntax/ext/registrar.rs
index f0bad1b40eb..4c18eb83afc 100644
--- a/src/libsyntax/ext/registrar.rs
+++ b/src/libsyntax/ext/registrar.rs
@@ -15,15 +15,18 @@ use diagnostic;
 use visit;
 use visit::Visitor;
 
+use std::vec_ng::Vec;
+
 struct MacroRegistrarContext {
-    registrars: ~[(ast::NodeId, Span)],
+    registrars: Vec<(ast::NodeId, Span)> ,
 }
 
 impl Visitor<()> for MacroRegistrarContext {
     fn visit_item(&mut self, item: &ast::Item, _: ()) {
         match item.node {
             ast::ItemFn(..) => {
-                if attr::contains_name(item.attrs, "macro_registrar") {
+                if attr::contains_name(item.attrs.as_slice(),
+                                       "macro_registrar") {
                     self.registrars.push((item.id, item.span));
                 }
             }
@@ -36,7 +39,7 @@ impl Visitor<()> for MacroRegistrarContext {
 
 pub fn find_macro_registrar(diagnostic: @diagnostic::SpanHandler,
                             krate: &ast::Crate) -> Option<ast::DefId> {
-    let mut ctx = MacroRegistrarContext { registrars: ~[] };
+    let mut ctx = MacroRegistrarContext { registrars: Vec::new() };
     visit::walk_crate(&mut ctx, krate, ());
 
     match ctx.registrars.len() {
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index c81ee55c237..b31388f58eb 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -142,6 +142,7 @@ pub fn expand_include_bin(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
             return MacResult::dummy_expr(sp);
         }
         Ok(bytes) => {
+            let bytes = bytes.iter().map(|x| *x).collect();
             base::MRExpr(cx.expr_lit(sp, ast::LitBinary(Rc::new(bytes))))
         }
     }
diff --git a/src/libsyntax/ext/trace_macros.rs b/src/libsyntax/ext/trace_macros.rs
index db2c9dcddb6..183cccde18e 100644
--- a/src/libsyntax/ext/trace_macros.rs
+++ b/src/libsyntax/ext/trace_macros.rs
@@ -24,7 +24,7 @@ pub fn expand_trace_macros(cx: &mut ExtCtxt,
     let cfg = cx.cfg();
     let tt_rdr = new_tt_reader(cx.parse_sess().span_diagnostic,
                                None,
-                               tt.to_owned());
+                               tt.iter().map(|x| (*x).clone()).collect());
     let mut rust_parser = Parser(sess, cfg.clone(), tt_rdr.dup());
 
     if rust_parser.is_keyword(keywords::True) {
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index edd875a57a7..c9d3150c2cd 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -22,7 +22,7 @@ use parse::token::{Token, EOF, Nonterminal};
 use parse::token;
 
 use collections::HashMap;
-use std::vec;
+use std::vec_ng::Vec;
 
 /* This is an Earley-like parser, without support for in-grammar nonterminals,
 only by calling out to the main rust parser for named nonterminals (which it
@@ -99,11 +99,11 @@ nonempty body. */
 
 #[deriving(Clone)]
 pub struct MatcherPos {
-    elts: ~[ast::Matcher], // maybe should be <'>? Need to understand regions.
+    elts: Vec<ast::Matcher> , // maybe should be <'>? Need to understand regions.
     sep: Option<Token>,
     idx: uint,
     up: Option<~MatcherPos>,
-    matches: ~[~[@NamedMatch]],
+    matches: Vec<Vec<@NamedMatch>>,
     match_lo: uint, match_hi: uint,
     sp_lo: BytePos,
 }
@@ -112,12 +112,14 @@ pub fn count_names(ms: &[Matcher]) -> uint {
     ms.iter().fold(0, |ct, m| {
         ct + match m.node {
             MatchTok(_) => 0u,
-            MatchSeq(ref more_ms, _, _, _, _) => count_names((*more_ms)),
+            MatchSeq(ref more_ms, _, _, _, _) => {
+                count_names(more_ms.as_slice())
+            }
             MatchNonterminal(_, _, _) => 1u
         }})
 }
 
-pub fn initial_matcher_pos(ms: ~[Matcher], sep: Option<Token>, lo: BytePos)
+pub fn initial_matcher_pos(ms: Vec<Matcher> , sep: Option<Token>, lo: BytePos)
                         -> ~MatcherPos {
     let mut match_idx_hi = 0u;
     for elt in ms.iter() {
@@ -131,7 +133,7 @@ pub fn initial_matcher_pos(ms: ~[Matcher], sep: Option<Token>, lo: BytePos)
             }
         }
     }
-    let matches = vec::from_fn(count_names(ms), |_i| ~[]);
+    let matches = Vec::from_fn(count_names(ms.as_slice()), |_i| Vec::new());
     ~MatcherPos {
         elts: ms,
         sep: sep,
@@ -164,7 +166,7 @@ pub fn initial_matcher_pos(ms: ~[Matcher], sep: Option<Token>, lo: BytePos)
 // ast::Matcher it was derived from.
 
 pub enum NamedMatch {
-    MatchedSeq(~[@NamedMatch], codemap::Span),
+    MatchedSeq(Vec<@NamedMatch> , codemap::Span),
     MatchedNonterminal(Nonterminal)
 }
 
@@ -206,9 +208,9 @@ pub enum ParseResult {
 pub fn parse_or_else<R: Reader>(sess: @ParseSess,
                                 cfg: ast::CrateConfig,
                                 rdr: R,
-                                ms: ~[Matcher])
+                                ms: Vec<Matcher> )
                                 -> HashMap<Ident, @NamedMatch> {
-    match parse(sess, cfg, rdr, ms) {
+    match parse(sess, cfg, rdr, ms.as_slice()) {
         Success(m) => m,
         Failure(sp, str) => sess.span_diagnostic.span_fatal(sp, str),
         Error(sp, str) => sess.span_diagnostic.span_fatal(sp, str)
@@ -230,13 +232,17 @@ pub fn parse<R: Reader>(sess: @ParseSess,
                         rdr: R,
                         ms: &[Matcher])
                         -> ParseResult {
-    let mut cur_eis = ~[];
-    cur_eis.push(initial_matcher_pos(ms.to_owned(), None, rdr.peek().sp.lo));
+    let mut cur_eis = Vec::new();
+    cur_eis.push(initial_matcher_pos(ms.iter()
+                                       .map(|x| (*x).clone())
+                                       .collect(),
+                                     None,
+                                     rdr.peek().sp.lo));
 
     loop {
-        let mut bb_eis = ~[]; // black-box parsed by parser.rs
-        let mut next_eis = ~[]; // or proceed normally
-        let mut eof_eis = ~[];
+        let mut bb_eis = Vec::new(); // black-box parsed by parser.rs
+        let mut next_eis = Vec::new(); // or proceed normally
+        let mut eof_eis = Vec::new();
 
         let TokenAndSpan {tok: tok, sp: sp} = rdr.peek();
 
@@ -274,8 +280,9 @@ pub fn parse<R: Reader>(sess: @ParseSess,
 
                         // Only touch the binders we have actually bound
                         for idx in range(ei.match_lo, ei.match_hi) {
-                            let sub = ei.matches[idx].clone();
-                            new_pos.matches[idx]
+                            let sub = (*ei.matches.get(idx)).clone();
+                            new_pos.matches
+                                   .get_mut(idx)
                                    .push(@MatchedSeq(sub, mk_sp(ei.sp_lo,
                                                                 sp.hi)));
                         }
@@ -308,7 +315,7 @@ pub fn parse<R: Reader>(sess: @ParseSess,
                     eof_eis.push(ei);
                 }
             } else {
-                match ei.elts[idx].node.clone() {
+                match ei.elts.get(idx).node.clone() {
                   /* need to descend into sequence */
                   MatchSeq(ref matchers, ref sep, zero_ok,
                            match_idx_lo, match_idx_hi) => {
@@ -317,13 +324,15 @@ pub fn parse<R: Reader>(sess: @ParseSess,
                         new_ei.idx += 1u;
                         //we specifically matched zero repeats.
                         for idx in range(match_idx_lo, match_idx_hi) {
-                            new_ei.matches[idx].push(@MatchedSeq(~[], sp));
+                            new_ei.matches
+                                  .get_mut(idx)
+                                  .push(@MatchedSeq(Vec::new(), sp));
                         }
 
                         cur_eis.push(new_ei);
                     }
 
-                    let matches = vec::from_elem(ei.matches.len(), ~[]);
+                    let matches = Vec::from_elem(ei.matches.len(), Vec::new());
                     let ei_t = ei;
                     cur_eis.push(~MatcherPos {
                         elts: (*matchers).clone(),
@@ -351,11 +360,11 @@ pub fn parse<R: Reader>(sess: @ParseSess,
         /* error messages here could be improved with links to orig. rules */
         if token_name_eq(&tok, &EOF) {
             if eof_eis.len() == 1u {
-                let mut v = ~[];
-                for dv in eof_eis[0u].matches.mut_iter() {
+                let mut v = Vec::new();
+                for dv in eof_eis.get_mut(0).matches.mut_iter() {
                     v.push(dv.pop().unwrap());
                 }
-                return Success(nameize(sess, ms, v));
+                return Success(nameize(sess, ms, v.as_slice()));
             } else if eof_eis.len() > 1u {
                 return Error(sp, ~"ambiguity: multiple successful parses");
             } else {
@@ -365,7 +374,7 @@ pub fn parse<R: Reader>(sess: @ParseSess,
             if (bb_eis.len() > 0u && next_eis.len() > 0u)
                 || bb_eis.len() > 1u {
                 let nts = bb_eis.map(|ei| {
-                    match ei.elts[ei.idx].node {
+                    match ei.elts.get(ei.idx).node {
                       MatchNonterminal(bind, name, _) => {
                         format!("{} ('{}')",
                                 token::get_ident(name),
@@ -390,10 +399,10 @@ pub fn parse<R: Reader>(sess: @ParseSess,
                 let mut rust_parser = Parser(sess, cfg.clone(), rdr.dup());
 
                 let mut ei = bb_eis.pop().unwrap();
-                match ei.elts[ei.idx].node {
+                match ei.elts.get(ei.idx).node {
                   MatchNonterminal(_, name, idx) => {
                     let name_string = token::get_ident(name);
-                    ei.matches[idx].push(@MatchedNonterminal(
+                    ei.matches.get_mut(idx).push(@MatchedNonterminal(
                         parse_nt(&mut rust_parser, name_string.get())));
                     ei.idx += 1u;
                   }
@@ -413,12 +422,12 @@ pub fn parse<R: Reader>(sess: @ParseSess,
 
 pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal {
     match name {
-      "item" => match p.parse_item(~[]) {
+      "item" => match p.parse_item(Vec::new()) {
         Some(i) => token::NtItem(i),
         None => p.fatal("expected an item keyword")
       },
       "block" => token::NtBlock(p.parse_block()),
-      "stmt" => token::NtStmt(p.parse_stmt(~[])),
+      "stmt" => token::NtStmt(p.parse_stmt(Vec::new())),
       "pat" => token::NtPat(p.parse_pat()),
       "expr" => token::NtExpr(p.parse_expr()),
       "ty" => token::NtTy(p.parse_ty(false /* no need to disambiguate*/)),
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index 45fe24ebf68..712d5f6bd27 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -25,9 +25,11 @@ use parse::token::{special_idents, gensym_ident};
 use parse::token::{FAT_ARROW, SEMI, NtMatchers, NtTT, EOF};
 use parse::token;
 use print;
-use std::cell::RefCell;
 use util::small_vector::SmallVector;
 
+use std::cell::RefCell;
+use std::vec_ng::Vec;
+
 struct ParserAnyMacro {
     parser: RefCell<Parser>,
 }
@@ -90,8 +92,8 @@ impl AnyMacro for ParserAnyMacro {
 
 struct MacroRulesMacroExpander {
     name: Ident,
-    lhses: @~[@NamedMatch],
-    rhses: @~[@NamedMatch],
+    lhses: @Vec<@NamedMatch> ,
+    rhses: @Vec<@NamedMatch> ,
 }
 
 impl MacroExpander for MacroRulesMacroExpander {
@@ -100,7 +102,12 @@ impl MacroExpander for MacroRulesMacroExpander {
               sp: Span,
               arg: &[ast::TokenTree])
               -> MacResult {
-        generic_extension(cx, sp, self.name, arg, *self.lhses, *self.rhses)
+        generic_extension(cx,
+                          sp,
+                          self.name,
+                          arg,
+                          self.lhses.as_slice(),
+                          self.rhses.as_slice())
     }
 }
 
@@ -115,7 +122,9 @@ fn generic_extension(cx: &ExtCtxt,
     if cx.trace_macros() {
         println!("{}! \\{ {} \\}",
                  token::get_ident(name),
-                 print::pprust::tt_to_str(&TTDelim(@arg.to_owned())));
+                 print::pprust::tt_to_str(&TTDelim(@arg.iter()
+                                                       .map(|x| (*x).clone())
+                                                       .collect())));
     }
 
     // Which arm's failure should we report? (the one furthest along)
@@ -128,8 +137,12 @@ fn generic_extension(cx: &ExtCtxt,
         match **lhs {
           MatchedNonterminal(NtMatchers(ref mtcs)) => {
             // `None` is because we're not interpolating
-            let arg_rdr = new_tt_reader(s_d, None, arg.to_owned());
-            match parse(cx.parse_sess(), cx.cfg(), arg_rdr, *mtcs) {
+            let arg_rdr = new_tt_reader(s_d,
+                                        None,
+                                        arg.iter()
+                                           .map(|x| (*x).clone())
+                                           .collect());
+            match parse(cx.parse_sess(), cx.cfg(), arg_rdr, mtcs.as_slice()) {
               Success(named_matches) => {
                 let rhs = match *rhses[i] {
                     // okay, what's your transcriber?
@@ -137,7 +150,10 @@ fn generic_extension(cx: &ExtCtxt,
                         match *tt {
                             // cut off delimiters; don't parse 'em
                             TTDelim(ref tts) => {
-                                (*tts).slice(1u,(*tts).len()-1u).to_owned()
+                                (*tts).slice(1u,(*tts).len()-1u)
+                                      .iter()
+                                      .map(|x| (*x).clone())
+                                      .collect()
                             }
                             _ => cx.span_fatal(
                                 sp, "macro rhs must be delimited")
@@ -174,7 +190,7 @@ fn generic_extension(cx: &ExtCtxt,
 pub fn add_new_extension(cx: &mut ExtCtxt,
                          sp: Span,
                          name: Ident,
-                         arg: ~[ast::TokenTree])
+                         arg: Vec<ast::TokenTree> )
                          -> base::MacResult {
     // these spans won't matter, anyways
     fn ms(m: Matcher_) -> Matcher {
@@ -191,15 +207,14 @@ pub fn add_new_extension(cx: &mut ExtCtxt,
     // The grammar for macro_rules! is:
     // $( $lhs:mtcs => $rhs:tt );+
     // ...quasiquoting this would be nice.
-    let argument_gram = ~[
-        ms(MatchSeq(~[
+    let argument_gram = vec!(
+        ms(MatchSeq(vec!(
             ms(MatchNonterminal(lhs_nm, special_idents::matchers, 0u)),
             ms(MatchTok(FAT_ARROW)),
-            ms(MatchNonterminal(rhs_nm, special_idents::tt, 1u)),
-        ], Some(SEMI), false, 0u, 2u)),
+            ms(MatchNonterminal(rhs_nm, special_idents::tt, 1u))), Some(SEMI), false, 0u, 2u)),
         //to phase into semicolon-termination instead of
         //semicolon-separation
-        ms(MatchSeq(~[ms(MatchTok(SEMI))], None, true, 2u, 2u))];
+        ms(MatchSeq(vec!(ms(MatchTok(SEMI))), None, true, 2u, 2u)));
 
 
     // Parse the macro_rules! invocation (`none` is for no interpolations):
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index a8c9fe37226..a3f179e851a 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -18,11 +18,12 @@ use parse::token;
 use parse::lexer::TokenAndSpan;
 
 use std::cell::{Cell, RefCell};
+use std::vec_ng::Vec;
 use collections::HashMap;
 
 ///an unzipping of `TokenTree`s
 struct TtFrame {
-    forest: @~[ast::TokenTree],
+    forest: @Vec<ast::TokenTree> ,
     idx: Cell<uint>,
     dotdotdoted: bool,
     sep: Option<Token>,
@@ -35,8 +36,8 @@ pub struct TtReader {
     priv stack: RefCell<@TtFrame>,
     /* for MBE-style macro transcription */
     priv interpolations: RefCell<HashMap<Ident, @NamedMatch>>,
-    priv repeat_idx: RefCell<~[uint]>,
-    priv repeat_len: RefCell<~[uint]>,
+    priv repeat_idx: RefCell<Vec<uint> >,
+    priv repeat_len: RefCell<Vec<uint> >,
     /* cached: */
     cur_tok: RefCell<Token>,
     cur_span: RefCell<Span>,
@@ -47,7 +48,7 @@ pub struct TtReader {
  *  should) be none. */
 pub fn new_tt_reader(sp_diag: @SpanHandler,
                      interp: Option<HashMap<Ident, @NamedMatch>>,
-                     src: ~[ast::TokenTree])
+                     src: Vec<ast::TokenTree> )
                      -> TtReader {
     let r = TtReader {
         sp_diag: sp_diag,
@@ -62,8 +63,8 @@ pub fn new_tt_reader(sp_diag: @SpanHandler,
             None => RefCell::new(HashMap::new()),
             Some(x) => RefCell::new(x),
         },
-        repeat_idx: RefCell::new(~[]),
-        repeat_len: RefCell::new(~[]),
+        repeat_idx: RefCell::new(Vec::new()),
+        repeat_len: RefCell::new(Vec::new()),
         /* dummy values, never read: */
         cur_tok: RefCell::new(EOF),
         cur_span: RefCell::new(DUMMY_SP),
@@ -106,7 +107,7 @@ fn lookup_cur_matched_by_matched(r: &TtReader, start: @NamedMatch)
                 // end of the line; duplicate henceforth
                 ad
             }
-            MatchedSeq(ref ads, _) => ads[*idx]
+            MatchedSeq(ref ads, _) => *ads.get(*idx)
         }
     }
     let repeat_idx = r.repeat_idx.borrow();
@@ -217,7 +218,8 @@ pub fn tt_next_token(r: &TtReader) -> TokenAndSpan {
             r.stack.get().idx.set(0u);
             {
                 let mut repeat_idx = r.repeat_idx.borrow_mut();
-                repeat_idx.get()[repeat_idx.get().len() - 1u] += 1u;
+                let last_repeat_idx = repeat_idx.get().len() - 1u;
+                *repeat_idx.get().get_mut(last_repeat_idx) += 1u;
             }
             match r.stack.get().sep.clone() {
               Some(tk) => {
@@ -231,7 +233,7 @@ pub fn tt_next_token(r: &TtReader) -> TokenAndSpan {
     loop { /* because it's easiest, this handles `TTDelim` not starting
     with a `TTTok`, even though it won't happen */
         // FIXME(pcwalton): Bad copy.
-        match r.stack.get().forest[r.stack.get().idx.get()].clone() {
+        match (*r.stack.get().forest.get(r.stack.get().idx.get())).clone() {
           TTDelim(tts) => {
             r.stack.set(@TtFrame {
                 forest: tts,