]> git.lizzy.rs Git - rust.git/commitdiff
Port the compiler to the ivec type [T] syntax.
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Thu, 4 Aug 2011 23:20:09 +0000 (16:20 -0700)
committerBrian Anderson <banderson@mozilla.com>
Tue, 9 Aug 2011 22:53:26 +0000 (15:53 -0700)
50 files changed:
src/comp/back/link.rs
src/comp/back/upcall.rs
src/comp/driver/session.rs
src/comp/front/attr.rs
src/comp/front/config.rs
src/comp/front/test.rs
src/comp/lib/llvm.rs
src/comp/metadata/creader.rs
src/comp/metadata/csearch.rs
src/comp/metadata/cstore.rs
src/comp/metadata/decoder.rs
src/comp/metadata/encoder.rs
src/comp/metadata/tydecode.rs
src/comp/metadata/tyencode.rs
src/comp/middle/alias.rs
src/comp/middle/check_alt.rs
src/comp/middle/freevars.rs
src/comp/middle/resolve.rs
src/comp/middle/shape.rs
src/comp/middle/trans.rs
src/comp/middle/trans_alt.rs
src/comp/middle/trans_comm.rs
src/comp/middle/trans_common.rs
src/comp/middle/tstate/annotate.rs
src/comp/middle/tstate/auxiliary.rs
src/comp/middle/tstate/bitvectors.rs
src/comp/middle/tstate/ck.rs
src/comp/middle/tstate/collect_locals.rs
src/comp/middle/tstate/pre_post_conditions.rs
src/comp/middle/tstate/states.rs
src/comp/middle/tstate/tritv.rs
src/comp/middle/ty.rs
src/comp/middle/typeck.rs
src/comp/syntax/ast.rs
src/comp/syntax/codemap.rs
src/comp/syntax/ext/concat_idents.rs
src/comp/syntax/ext/env.rs
src/comp/syntax/ext/fmt.rs
src/comp/syntax/ext/ident_to_str.rs
src/comp/syntax/ext/simplext.rs
src/comp/syntax/fold.rs
src/comp/syntax/parse/eval.rs
src/comp/syntax/parse/lexer.rs
src/comp/syntax/parse/parser.rs
src/comp/syntax/print/pp.rs
src/comp/syntax/print/pprust.rs
src/comp/syntax/util/interner.rs
src/comp/syntax/visit.rs
src/comp/util/common.rs
src/comp/util/ppaux.rs

index 98f540de7e816317c6738beb9aa21fa8929cba9d..1fb3bfd039f0a9e01b13d260fb9c0c88be230b73 100644 (file)
@@ -272,13 +272,13 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
     type provided_metas =
         {name: option::t[str],
          vers: option::t[str],
-         cmh_items: (@ast::meta_item)[]};
+         cmh_items: [@ast::meta_item]};
 
     fn provided_link_metas(sess: &session::session, c: &ast::crate) ->
        provided_metas {
         let name: option::t[str] = none;
         let vers: option::t[str] = none;
-        let cmh_items: (@ast::meta_item)[] = ~[];
+        let cmh_items: [@ast::meta_item] = ~[];
         let linkage_metas = attr::find_linkage_metas(c.node.attrs);
         attr::require_unique_names(sess, linkage_metas);
         for meta: @ast::meta_item  in linkage_metas {
@@ -412,7 +412,7 @@ fn get_symbol_hash(ccx: &@crate_ctxt, t: &ty::t) -> str {
     ret hash;
 }
 
-fn mangle(ss: &str[]) -> str {
+fn mangle(ss: &[str]) -> str {
     // Follow C++ namespace-mangling style
 
     let n = "_ZN"; // Begin name-sequence.
@@ -423,14 +423,14 @@ fn mangle(ss: &str[]) -> str {
     ret n;
 }
 
-fn exported_name(path: &str[], hash: &str, vers: &str) -> str {
+fn exported_name(path: &[str], hash: &str, vers: &str) -> str {
     // FIXME: versioning isn't working yet
 
     ret mangle(path + ~[hash]); //  + "@" + vers;
 
 }
 
-fn mangle_exported_name(ccx: &@crate_ctxt, path: &str[], t: &ty::t) -> str {
+fn mangle_exported_name(ccx: &@crate_ctxt, path: &[str], t: &ty::t) -> str {
     let hash = get_symbol_hash(ccx, t);
     ret exported_name(path, hash, ccx.link_meta.vers);
 }
@@ -442,12 +442,12 @@ fn mangle_internal_name_by_type_only(ccx: &@crate_ctxt, t: &ty::t, name: &str)
     ret mangle(~[name, s, hash]);
 }
 
-fn mangle_internal_name_by_path_and_seq(ccx: &@crate_ctxt, path: &str[],
+fn mangle_internal_name_by_path_and_seq(ccx: &@crate_ctxt, path: &[str],
                                         flav: &str) -> str {
     ret mangle(path + ~[ccx.names.next(flav)]);
 }
 
-fn mangle_internal_name_by_path(ccx: &@crate_ctxt, path: &str[]) -> str {
+fn mangle_internal_name_by_path(ccx: &@crate_ctxt, path: &[str]) -> str {
     ret mangle(path);
 }
 
index 249e500884b3cfe79a35c3934586cb479ee5cbf9..cc080682fd472de5139c381468e0c230aeeb46e6 100644 (file)
@@ -71,9 +71,9 @@
 
 fn declare_upcalls(tn: type_names, tydesc_type: TypeRef,
                    taskptr_type: TypeRef, llmod: ModuleRef) -> @upcalls {
-    fn decl(tn: type_names, llmod: ModuleRef, name: str, tys: TypeRef[],
+    fn decl(tn: type_names, llmod: ModuleRef, name: str, tys: [TypeRef],
           rv: TypeRef) -> ValueRef {
-        let arg_tys: TypeRef[] = ~[];
+        let arg_tys: [TypeRef] = ~[];
         for t: TypeRef  in tys { arg_tys += ~[t]; }
         let fn_ty = T_fn(arg_tys, rv);
         ret trans::decl_cdecl_fn(llmod, "upcall_" + name, fn_ty);
@@ -87,7 +87,7 @@ fn decl_with_taskptr(taskptr_type: TypeRef, tn: type_names,
     let d = bind decl_with_taskptr(taskptr_type, tn, llmod, _, _, _);
     let dr = bind decl(tn, llmod, _, _, _);
 
-    let empty_vec: TypeRef[] = ~[];
+    let empty_vec: [TypeRef] = ~[];
     ret @{grow_task: dv("grow_task", ~[T_size_t()]),
           log_int: dv("log_int", ~[T_i32(), T_i32()]),
           log_float: dv("log_float", ~[T_i32(), T_f32()]),
index 2ded0723845ab6bc65524ee996e17802bb5c855c..ebb9672374cbff50a4677c18b67cbc6b8ac47f33 100644 (file)
@@ -37,7 +37,7 @@
      time_passes: bool,
      time_llvm_passes: bool,
      output_type: back::link::output_type,
-     library_search_paths: str[],
+     library_search_paths: [str],
      sysroot: str,
      cfg: ast::crate_cfg,
      test: bool,
@@ -46,7 +46,7 @@
      no_trans: bool
      };
 
-type crate_metadata = {name: str, data: u8[]};
+type crate_metadata = {name: str, data: [u8]};
 
 obj session(targ_cfg: @config,
             opts: @options,
index a8361ba64eedb0f2f520dd7311208e4131f01019..061193022cbdc3e8c4b4df753b11a05f49554263 100644 (file)
@@ -29,8 +29,8 @@
 
 // From a list of crate attributes get only the meta_items that impact crate
 // linkage
-fn find_linkage_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
-    let metas: (@ast::meta_item)[] = ~[];
+fn find_linkage_metas(attrs: &[ast::attribute]) -> [@ast::meta_item] {
+    let metas: [@ast::meta_item] = ~[];
     for attr: ast::attribute  in find_attrs_by_name(attrs, "link") {
         alt attr.node.value.node {
           ast::meta_list(_, items) { metas += items; }
@@ -41,8 +41,8 @@ fn find_linkage_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
 }
 
 // Search a list of attributes and return only those with a specific name
-fn find_attrs_by_name(attrs: &ast::attribute[], name: ast::ident) ->
-   ast::attribute[] {
+fn find_attrs_by_name(attrs: &[ast::attribute], name: ast::ident) ->
+   [ast::attribute] {
     let filter =
         bind fn (a: &ast::attribute, name: ast::ident) ->
                 option::t[ast::attribute] {
@@ -57,8 +57,8 @@ fn get_attr_name(attr: &ast::attribute) -> ast::ident {
     get_meta_item_name(@attr.node.value)
 }
 
-fn find_meta_items_by_name(metas: &(@ast::meta_item)[], name: ast::ident) ->
-   (@ast::meta_item)[] {
+fn find_meta_items_by_name(metas: &[@ast::meta_item], name: ast::ident) ->
+   [@ast::meta_item] {
     let filter =
         bind fn (m: &@ast::meta_item, name: ast::ident) ->
                 option::t[@ast::meta_item] {
@@ -94,7 +94,7 @@ fn get_meta_item_value_str(meta: &@ast::meta_item) -> option::t[str] {
 fn attr_meta(attr: &ast::attribute) -> @ast::meta_item { @attr.node.value }
 
 // Get the meta_items from inside a vector of attributes
-fn attr_metas(attrs: &ast::attribute[]) -> (@ast::meta_item)[] {
+fn attr_metas(attrs: &[ast::attribute]) -> [@ast::meta_item] {
     let mitems = ~[];
     for a: ast::attribute  in attrs { mitems += ~[attr_meta(a)]; }
     ret mitems;
@@ -121,7 +121,7 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
         }
 }
 
-fn contains(haystack: &(@ast::meta_item)[], needle: @ast::meta_item) -> bool {
+fn contains(haystack: &[@ast::meta_item], needle: @ast::meta_item) -> bool {
     log #fmt("looking for %s",
              syntax::print::pprust::meta_item_to_str(*needle));
     for item: @ast::meta_item  in haystack {
@@ -133,13 +133,13 @@ fn contains(haystack: &(@ast::meta_item)[], needle: @ast::meta_item) -> bool {
     ret false;
 }
 
-fn contains_name(metas: &(@ast::meta_item)[], name: ast::ident) -> bool {
+fn contains_name(metas: &[@ast::meta_item], name: ast::ident) -> bool {
     let matches = find_meta_items_by_name(metas, name);
     ret ivec::len(matches) > 0u;
 }
 
 // FIXME: This needs to sort by meta_item variant in addition to the item name
-fn sort_meta_items(items: &(@ast::meta_item)[]) -> (@ast::meta_item)[] {
+fn sort_meta_items(items: &[@ast::meta_item]) -> [@ast::meta_item] {
     fn lteq(ma: &@ast::meta_item, mb: &@ast::meta_item) -> bool {
         fn key(m: &@ast::meta_item) -> ast::ident {
             alt m.node {
@@ -152,18 +152,18 @@ fn key(m: &@ast::meta_item) -> ast::ident {
     }
 
     // This is sort of stupid here, converting to a vec of mutables and back
-    let v: (@ast::meta_item)[mutable ] = ~[mutable ];
+    let v: [mutable @ast::meta_item] = ~[mutable];
     for mi: @ast::meta_item  in items { v += ~[mutable mi]; }
 
     std::sort::ivector::quick_sort(lteq, v);
 
-    let v2: (@ast::meta_item)[] = ~[];
+    let v2: [@ast::meta_item] = ~[];
     for mi: @ast::meta_item  in v { v2 += ~[mi]; }
     ret v2;
 }
 
-fn remove_meta_items_by_name(items: &(@ast::meta_item)[], name: str) ->
-   (@ast::meta_item)[] {
+fn remove_meta_items_by_name(items: &[@ast::meta_item], name: str) ->
+   [@ast::meta_item] {
 
     let filter =
         bind fn (item: &@ast::meta_item, name: str) ->
@@ -177,7 +177,7 @@ fn remove_meta_items_by_name(items: &(@ast::meta_item)[], name: str) ->
 }
 
 fn require_unique_names(sess: &session::session,
-                        metas: &(@ast::meta_item)[]) {
+                        metas: &[@ast::meta_item]) {
     let map = map::mk_hashmap[str, ()](str::hash, str::eq);
     for meta: @ast::meta_item  in metas {
         let name = get_meta_item_name(meta);
@@ -202,7 +202,7 @@ fn mk_name_value_item(name: ast::ident, value: ast::lit) -> @ast::meta_item {
     ret @span(ast::meta_name_value(name, value));
 }
 
-fn mk_list_item(name: ast::ident, items: &(@ast::meta_item)[]) ->
+fn mk_list_item(name: ast::ident, items: &[@ast::meta_item]) ->
    @ast::meta_item {
     ret @span(ast::meta_list(name, items));
 }
index e1e580f191eca22c484ba51101ba286b3a7d109a..fb5222b0c57502791d71f48908f67fa84fb54559 100644 (file)
@@ -91,7 +91,7 @@ fn native_item_in_cfg(cfg: &ast::crate_cfg, item: &@ast::native_item) ->
 
 // Determine if an item should be translated in the current crate
 // configuration based on the item's attributes
-fn in_cfg(cfg: &ast::crate_cfg, attrs: &ast::attribute[]) -> bool {
+fn in_cfg(cfg: &ast::crate_cfg, attrs: &[ast::attribute]) -> bool {
 
     // The "cfg" attributes on the item
     let item_cfg_attrs = attr::find_attrs_by_name(attrs, "cfg");
@@ -103,9 +103,9 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &ast::attribute[]) -> bool {
     // which the item is valid
     let item_cfg_metas =
         {
-            fn extract_metas(inner_items: &(@ast::meta_item)[],
+            fn extract_metas(inner_items: &[@ast::meta_item],
                              cfg_item: &@ast::meta_item) ->
-               (@ast::meta_item)[] {
+               [@ast::meta_item] {
                 alt cfg_item.node {
                   ast::meta_list(name, items) {
                     assert (name == "cfg");
index 23dadca206e5f51004412dd9e0e32f7596d294bc..8604b64880876e2facaf953c8f646636a6085d3e 100644 (file)
 
 type node_id_gen = @fn() -> ast::node_id ;
 
-type test = {path: ast::ident[], ignore: bool};
+type test = {path: [ast::ident], ignore: bool};
 
 type test_ctxt =
     @{next_node_id: node_id_gen,
-      mutable path: ast::ident[],
-      mutable testfns: test[]};
+      mutable path: [ast::ident],
+      mutable testfns: [test]};
 
 // Traverse the crate, collecting all the test functions, eliding any
 // existing main functions, and synthesizing a main test harness
@@ -139,7 +139,7 @@ fn main(vec[str] args) -> int {
     std::test::test_main(args, tests())
   }
 
-  fn tests() -> std::test::test_desc[] {
+  fn tests() -> [std::test::test_desc] {
     ... the list of tests in the crate ...
   }
 }
@@ -211,7 +211,7 @@ fn empty_fn_ty() -> ast::ty {
     ret nospan(ast::ty_fn(proto, input_ty, ret_ty, cf, constrs));
 }
 
-// The ast::ty of std::test::test_desc[]
+// The ast::ty of [std::test::test_desc]
 fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
     let test_desc_ty_path: ast::path =
         nospan({global: false,
index 9f08bbb9476ff9841f17ac785b4800ebec4769e5..62ad92ac380f7c5c92f84bb932bcddaf3cf89d3b 100644 (file)
@@ -909,7 +909,7 @@ fn Ret(V: ValueRef) -> ValueRef {
         ret llvm::LLVMBuildRet(B, V);
     }
 
-    fn AggregateRet(RetVals: &ValueRef[]) -> ValueRef {
+    fn AggregateRet(RetVals: &[ValueRef]) -> ValueRef {
         assert (!*terminated);
         *terminated = true;
         ret llvm::LLVMBuildAggregateRet(B, ivec::to_ptr(RetVals),
@@ -941,7 +941,7 @@ fn IndirectBr(Addr: ValueRef, NumDests: uint) -> ValueRef {
         ret llvm::LLVMBuildIndirectBr(B, Addr, NumDests);
     }
 
-    fn Invoke(Fn: ValueRef, Args: &ValueRef[], Then: BasicBlockRef,
+    fn Invoke(Fn: ValueRef, Args: &[ValueRef], Then: BasicBlockRef,
               Catch: BasicBlockRef) -> ValueRef {
         assert (!*terminated);
         *terminated = true;
@@ -1151,13 +1151,13 @@ fn Store(Val: ValueRef, Ptr: ValueRef) -> ValueRef {
         ret llvm::LLVMBuildStore(B, Val, Ptr);
     }
 
-    fn GEP(Pointer: ValueRef, Indices: &ValueRef[]) -> ValueRef {
+    fn GEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
         assert (!*terminated);
         ret llvm::LLVMBuildGEP(B, Pointer, ivec::to_ptr(Indices),
                                ivec::len(Indices), str::buf(""));
     }
 
-    fn InBoundsGEP(Pointer: ValueRef, Indices: &ValueRef[]) -> ValueRef {
+    fn InBoundsGEP(Pointer: ValueRef, Indices: &[ValueRef]) -> ValueRef {
         assert (!*terminated);
         ret llvm::LLVMBuildInBoundsGEP(B, Pointer, ivec::to_ptr(Indices),
                                        ivec::len(Indices), str::buf(""));
@@ -1289,7 +1289,7 @@ fn FCmp(Op: uint, LHS: ValueRef, RHS: ValueRef) -> ValueRef {
 
 
     /* Miscellaneous instructions */
-    fn Phi(Ty: TypeRef, vals: &ValueRef[], bbs: &BasicBlockRef[]) ->
+    fn Phi(Ty: TypeRef, vals: &[ValueRef], bbs: &[BasicBlockRef]) ->
        ValueRef {
         assert (!*terminated);
         let phi = llvm::LLVMBuildPhi(B, Ty, str::buf(""));
@@ -1299,20 +1299,20 @@ fn Phi(Ty: TypeRef, vals: &ValueRef[], bbs: &BasicBlockRef[]) ->
         ret phi;
     }
 
-    fn AddIncomingToPhi(phi: ValueRef, vals: &ValueRef[],
-                        bbs: &BasicBlockRef[]) {
+    fn AddIncomingToPhi(phi: ValueRef, vals: &[ValueRef],
+                        bbs: &[BasicBlockRef]) {
         assert (ivec::len[ValueRef](vals) == ivec::len[BasicBlockRef](bbs));
         llvm::LLVMAddIncoming(phi, ivec::to_ptr(vals), ivec::to_ptr(bbs),
                               ivec::len(vals));
     }
 
-    fn Call(Fn: ValueRef, Args: &ValueRef[]) -> ValueRef {
+    fn Call(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
         assert (!*terminated);
         ret llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
                                 str::buf(""));
     }
 
-    fn FastCall(Fn: ValueRef, Args: &ValueRef[]) -> ValueRef {
+    fn FastCall(Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
         assert (!*terminated);
         let v =
             llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
@@ -1321,7 +1321,7 @@ fn FastCall(Fn: ValueRef, Args: &ValueRef[]) -> ValueRef {
         ret v;
     }
 
-    fn CallWithConv(Fn: ValueRef, Args: &ValueRef[], Conv: uint) -> ValueRef {
+    fn CallWithConv(Fn: ValueRef, Args: &[ValueRef], Conv: uint) -> ValueRef {
         assert (!*terminated);
         let v =
             llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args), ivec::len(Args),
@@ -1392,7 +1392,7 @@ fn Trap() -> ValueRef {
         let T: ValueRef =
             llvm::LLVMGetNamedFunction(M, str::buf("llvm.trap"));
         assert (T as int != 0);
-        let Args: ValueRef[] = ~[];
+        let Args: [ValueRef] = ~[];
         ret llvm::LLVMBuildCall(B, T, ivec::to_ptr(Args), ivec::len(Args),
                                 str::buf(""));
     }
@@ -1447,7 +1447,7 @@ fn type_to_str(names: type_names, ty: TypeRef) -> str {
     ret type_to_str_inner(names, ~[], ty);
 }
 
-fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
+fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
    str {
 
     if names.type_has_name(ty) { ret names.get_name(ty); }
@@ -1456,7 +1456,7 @@ fn type_to_str_inner(names: type_names, outer0: &TypeRef[], ty: TypeRef) ->
 
     let kind: int = llvm::LLVMGetTypeKind(ty);
 
-    fn tys_str(names: type_names, outer: &TypeRef[], tys: &TypeRef[]) -> str {
+    fn tys_str(names: type_names, outer: &[TypeRef], tys: &[TypeRef]) -> str {
         let s: str = "";
         let first: bool = true;
         for t: TypeRef  in tys {
@@ -1493,7 +1493,7 @@ fn tys_str(names: type_names, outer: &TypeRef[], tys: &TypeRef[]) -> str {
         let s = "fn(";
         let out_ty: TypeRef = llvm::LLVMGetReturnType(ty);
         let n_args: uint = llvm::LLVMCountParamTypes(ty);
-        let args: TypeRef[] = ivec::init_elt[TypeRef](0 as TypeRef, n_args);
+        let args: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_args);
         llvm::LLVMGetParamTypes(ty, ivec::to_ptr(args));
         s += tys_str(names, outer, args);
         s += ") -> ";
@@ -1505,7 +1505,7 @@ fn tys_str(names: type_names, outer: &TypeRef[], tys: &TypeRef[]) -> str {
       9 {
         let s: str = "{";
         let n_elts: uint = llvm::LLVMCountStructElementTypes(ty);
-        let elts: TypeRef[] = ivec::init_elt[TypeRef](0 as TypeRef, n_elts);
+        let elts: [TypeRef] = ivec::init_elt[TypeRef](0 as TypeRef, n_elts);
         llvm::LLVMGetStructElementTypes(ty, ivec::to_ptr(elts));
         s += tys_str(names, outer, elts);
         s += "}";
@@ -1552,7 +1552,7 @@ fn float_width(llt: TypeRef) -> uint {
         };
 }
 
-fn fn_ty_param_tys(fn_ty: TypeRef) -> TypeRef[] {
+fn fn_ty_param_tys(fn_ty: TypeRef) -> [TypeRef] {
     let args = ivec::init_elt(0 as TypeRef, llvm::LLVMCountParamTypes(fn_ty));
     llvm::LLVMGetParamTypes(fn_ty, ivec::to_ptr(args));
     ret args;
index b0fa97f7ea9ee600b29cd1c59cfa53d84c9a92db..0bca7e600e3251e019d7a3c5910eb495e16c4763 100644 (file)
@@ -46,7 +46,7 @@ fn read_crates(sess: session::session, crate: &ast::crate) {
 type env =
     @{sess: session::session,
       crate_cache: @hashmap[str, int],
-      library_search_paths: str[],
+      library_search_paths: [str],
       mutable next_crate_num: ast::crate_num};
 
 fn visit_view_item(e: env, i: &@ast::view_item) {
@@ -89,7 +89,7 @@ fn list_file_metadata(path: str, out: ioivec::writer) {
     }
 }
 
-fn metadata_matches(crate_data: &@u8[], metas: &(@ast::meta_item)[]) -> bool {
+fn metadata_matches(crate_data: &@[u8], metas: &[@ast::meta_item]) -> bool {
     let attrs = decoder::get_crate_attributes(crate_data);
     let linkage_metas = attr::find_linkage_metas(attrs);
 
@@ -116,9 +116,9 @@ fn default_native_lib_naming(sess: session::session, static: bool) ->
 }
 
 fn find_library_crate(sess: &session::session, ident: &ast::ident,
-                      metas: &(@ast::meta_item)[],
-                      library_search_paths: &str[]) ->
-   option::t[{ident: str, data: @u8[]}] {
+                      metas: &[@ast::meta_item],
+                      library_search_paths: &[str]) ->
+   option::t[{ident: str, data: @[u8]}] {
 
     attr::require_unique_names(sess, metas);
 
@@ -146,9 +146,9 @@ fn find_library_crate(sess: &session::session, ident: &ast::ident,
 }
 
 fn find_library_crate_aux(nn: &{prefix: str, suffix: str}, crate_name: str,
-                          metas: &(@ast::meta_item)[],
-                          library_search_paths: &str[]) ->
-   option::t[{ident: str, data: @u8[]}] {
+                          metas: &[@ast::meta_item],
+                          library_search_paths: &[str]) ->
+   option::t[{ident: str, data: @[u8]}] {
     let prefix: str = nn.prefix + crate_name;
     // FIXME: we could probably use a 'glob' function in std::fs but it will
     // be much easier to write once the unsafe module knows more about FFI
@@ -183,10 +183,10 @@ fn find_library_crate_aux(nn: &{prefix: str, suffix: str}, crate_name: str,
     ret none;
 }
 
-fn get_metadata_section(filename: str) -> option::t[@u8[]] {
+fn get_metadata_section(filename: str) -> option::t[@[u8]] {
     let b = str::buf(filename);
     let mb = llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(b);
-    if mb as int == 0 { ret option::none[@u8[]]; }
+    if mb as int == 0 { ret option::none[@[u8]]; }
     let of = mk_object_file(mb);
     let si = mk_section_iter(of.llof);
     while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False {
@@ -196,17 +196,17 @@ fn get_metadata_section(filename: str) -> option::t[@u8[]] {
             let cbuf = llvm::LLVMGetSectionContents(si.llsi);
             let csz = llvm::LLVMGetSectionSize(si.llsi);
             let cvbuf: *u8 = std::unsafe::reinterpret_cast(cbuf);
-            ret option::some[@u8[]](@ivec::unsafe::from_buf(cvbuf, csz));
+            ret option::some[@[u8]](@ivec::unsafe::from_buf(cvbuf, csz));
         }
         llvm::LLVMMoveToNextSection(si.llsi);
     }
-    ret option::none[@u8[]];
+    ret option::none[@[u8]];
 }
 
 fn load_library_crate(sess: &session::session, span: span, ident: &ast::ident,
-                      metas: &(@ast::meta_item)[],
-                      library_search_paths: &str[]) ->
-   {ident: str, data: @u8[]} {
+                      metas: &[@ast::meta_item],
+                      library_search_paths: &[str]) ->
+   {ident: str, data: @[u8]} {
 
 
     alt find_library_crate(sess, ident, metas, library_search_paths) {
@@ -217,7 +217,7 @@ fn load_library_crate(sess: &session::session, span: span, ident: &ast::ident,
     }
 }
 
-fn resolve_crate(e: env, ident: ast::ident, metas: (@ast::meta_item)[],
+fn resolve_crate(e: env, ident: ast::ident, metas: [@ast::meta_item],
                  span: span) -> ast::crate_num {
     if !e.crate_cache.contains_key(ident) {
         let cinfo =
@@ -245,7 +245,7 @@ fn resolve_crate(e: env, ident: ast::ident, metas: (@ast::meta_item)[],
 }
 
 // Go through the crate metadata and load any crates that it references
-fn resolve_crate_deps(e: env, cdata: &@u8[]) -> cstore::cnum_map {
+fn resolve_crate_deps(e: env, cdata: &@[u8]) -> cstore::cnum_map {
     log "resolving deps of external crate";
     // The map from crate numbers in the crate we're resolving to local crate
     // numbers
index 7a397fff317c8288f15f5beb7b5208faf459c24b..d526ee05247b2f8a9a4f0254279b7c0d49047c25 100644 (file)
@@ -22,12 +22,12 @@ fn get_type_param_count(cstore: &cstore::cstore, def: &ast::def_id) -> uint {
 }
 
 fn lookup_defs(cstore: &cstore::cstore, cnum: ast::crate_num,
-               path: &ast::ident[]) -> ast::def[] {
+               path: &[ast::ident]) -> [ast::def] {
     let cdata = cstore::get_crate_data(cstore, cnum).data;
     ret decoder::lookup_defs(cdata, cnum, path);
 }
 
-fn get_tag_variants(tcx: ty::ctxt, def: ast::def_id) -> ty::variant_info[] {
+fn get_tag_variants(tcx: ty::ctxt, def: ast::def_id) -> [ty::variant_info] {
     let cstore = tcx.sess.get_cstore();
     let cnum = def.crate;
     let cdata = cstore::get_crate_data(cstore, cnum).data;
index 1b1249b8f9bd43da42aa773239b0d7cbc7908545..bebd695fda15e07228ba58447b2b2d55df1b29bc 100644 (file)
@@ -29,7 +29,7 @@
 // own crate numbers.
 type cnum_map = map::hashmap[ast::crate_num, ast::crate_num];
 
-type crate_metadata = {name: str, data: @u8[], cnum_map: cnum_map};
+type crate_metadata = {name: str, data: @[u8], cnum_map: cnum_map};
 
 // This is a bit of an experiment at encapsulating the data in cstore. By
 // keeping all the data in a non-exported tag variant, it's impossible for
@@ -41,9 +41,9 @@
 type cstore_private =
     @{metas: map::hashmap[ast::crate_num, crate_metadata],
       use_crate_map: use_crate_map,
-      mutable used_crate_files: str[],
-      mutable used_libraries: str[],
-      mutable used_link_args: str[]};
+      mutable used_crate_files: [str],
+      mutable used_libraries: [str],
+      mutable used_link_args: [str]};
 
 // Map from node_id's of local use statements to crate numbers
 type use_crate_map = map::hashmap[ast::node_id, ast::crate_num];
@@ -88,7 +88,7 @@ fn add_used_crate_file(cstore: &cstore, lib: &str) {
     }
 }
 
-fn get_used_crate_files(cstore: &cstore) -> str[] {
+fn get_used_crate_files(cstore: &cstore) -> [str] {
     ret p(cstore).used_crate_files;
 }
 
@@ -101,7 +101,7 @@ fn add_used_library(cstore: &cstore, lib: &str) -> bool {
     ret true;
 }
 
-fn get_used_libraries(cstore: &cstore) -> str[] {
+fn get_used_libraries(cstore: &cstore) -> [str] {
     ret p(cstore).used_libraries;
 }
 
@@ -114,7 +114,7 @@ fn add_used_link_args(cstore: &cstore, args: &str) {
     }
 }
 
-fn get_used_link_args(cstore: &cstore) -> str[] {
+fn get_used_link_args(cstore: &cstore) -> [str] {
     ret p(cstore).used_link_args;
 }
 
index 45c9dcf3b37aafc66106e12003f3659cbaa72350..56bd7754290a64e8a78e964364059f9e3e416d03 100644 (file)
@@ -35,8 +35,8 @@
 // build.
 type external_resolver = fn(&ast::def_id) -> ast::def_id ;
 
-fn lookup_hash(d: &ebmlivec::doc, eq_fn: fn(&u8[]) -> bool , hash: uint) ->
-   ebmlivec::doc[] {
+fn lookup_hash(d: &ebmlivec::doc, eq_fn: fn(&[u8]) -> bool , hash: uint) ->
+   [ebmlivec::doc] {
     let index = ebmlivec::get_doc(d, tag_index);
     let table = ebmlivec::get_doc(index, tag_index_table);
     let hash_pos = table.start + hash % 256u * 4u;
@@ -44,7 +44,7 @@ fn lookup_hash(d: &ebmlivec::doc, eq_fn: fn(&u8[]) -> bool , hash: uint) ->
     let bucket = ebmlivec::doc_at(d.data, pos);
     // Awkward logic because we can't ret from foreach yet
 
-    let result: ebmlivec::doc[] = ~[];
+    let result: [ebmlivec::doc] = ~[];
     let belt = tag_index_buckets_bucket_elt;
     for each elt: ebmlivec::doc  in ebmlivec::tagged_docs(bucket, belt) {
         let pos = ebmlivec::be_uint_from_bytes(elt.data, elt.start, 4u);
@@ -57,7 +57,7 @@ fn lookup_hash(d: &ebmlivec::doc, eq_fn: fn(&u8[]) -> bool , hash: uint) ->
 
 fn maybe_find_item(item_id: int, items: &ebmlivec::doc) ->
    option::t[ebmlivec::doc] {
-    fn eq_item(bytes: &u8[], item_id: int) -> bool {
+    fn eq_item(bytes: &[u8], item_id: int) -> bool {
         ret ebmlivec::be_uint_from_bytes(@bytes, 0u, 4u) as int == item_id;
     }
     let eqer = bind eq_item(_, item_id);
@@ -73,7 +73,7 @@ fn find_item(item_id: int, items: &ebmlivec::doc) -> ebmlivec::doc {
 
 // Looks up an item in the given metadata and returns an ebmlivec doc pointing
 // to the item data.
-fn lookup_item(item_id: int, data: &@u8[]) -> ebmlivec::doc {
+fn lookup_item(item_id: int, data: &@[u8]) -> ebmlivec::doc {
     let items = ebmlivec::get_doc(ebmlivec::new_doc(data), tag_items);
     ret find_item(item_id, items);
 }
@@ -114,11 +114,11 @@ fn parse_external_def_id(this_cnum: ast::crate_num,
                       def_parser, tcx);
 }
 
-fn item_ty_param_kinds(item: &ebmlivec::doc) -> ast::kind[] {
-    let ks: ast::kind[] = ~[];
+fn item_ty_param_kinds(item: &ebmlivec::doc) -> [ast::kind] {
+    let ks: [ast::kind] = ~[];
     let tp = tag_items_data_item_ty_param_kinds;
     for each p: ebmlivec::doc in ebmlivec::tagged_docs(item, tp) {
-        let dat : u8[] = ebmlivec::doc_data(p);
+        let dat : [u8] = ebmlivec::doc_data(p);
         let vi = ebmlivec::vint_at(dat, 0u);
         let i = 0u;
         while i < vi.val {
@@ -135,8 +135,8 @@ fn item_ty_param_kinds(item: &ebmlivec::doc) -> ast::kind[] {
 }
 
 fn tag_variant_ids(item: &ebmlivec::doc, this_cnum: ast::crate_num) ->
-   ast::def_id[] {
-    let ids: ast::def_id[] = ~[];
+   [ast::def_id] {
+    let ids: [ast::def_id] = ~[];
     let v = tag_items_data_item_variant;
     for each p: ebmlivec::doc  in ebmlivec::tagged_docs(item, v) {
         let ext = parse_def_id(ebmlivec::doc_data(p));
@@ -147,15 +147,15 @@ fn tag_variant_ids(item: &ebmlivec::doc, this_cnum: ast::crate_num) ->
 
 // Given a path and serialized crate metadata, returns the ID of the
 // definition the path refers to.
-fn resolve_path(path: &ast::ident[], data: @u8[]) -> ast::def_id[] {
-    fn eq_item(data: &u8[], s: str) -> bool {
+fn resolve_path(path: &[ast::ident], data: @[u8]) -> [ast::def_id] {
+    fn eq_item(data: &[u8], s: str) -> bool {
         ret str::eq(str::unsafe_from_bytes_ivec(data), s);
     }
     let s = str::connect_ivec(path, "::");
     let md = ebmlivec::new_doc(data);
     let paths = ebmlivec::get_doc(md, tag_paths);
     let eqer = bind eq_item(_, s);
-    let result: ast::def_id[] = ~[];
+    let result: [ast::def_id] = ~[];
     for doc: ebmlivec::doc  in lookup_hash(paths, eqer, hash_path(s)) {
         let did_doc = ebmlivec::get_doc(doc, tag_def_id);
         result += ~[parse_def_id(ebmlivec::doc_data(did_doc))];
@@ -164,14 +164,14 @@ fn eq_item(data: &u8[], s: str) -> bool {
 }
 
 // Crate metadata queries
-fn lookup_defs(data: &@u8[], cnum: ast::crate_num, path: &ast::ident[]) ->
-   ast::def[] {
+fn lookup_defs(data: &@[u8], cnum: ast::crate_num, path: &[ast::ident]) ->
+   [ast::def] {
     ret ivec::map(bind lookup_def(cnum, data, _), resolve_path(path, data));
 }
 
 
 // FIXME doesn't yet handle re-exported externals
-fn lookup_def(cnum: ast::crate_num, data: @u8[], did_: &ast::def_id) ->
+fn lookup_def(cnum: ast::crate_num, data: @[u8], did_: &ast::def_id) ->
    ast::def {
     let item = lookup_item(did_.node, data);
     let fam_ch = item_family(item);
@@ -197,13 +197,13 @@ fn lookup_def(cnum: ast::crate_num, data: @u8[], did_: &ast::def_id) ->
     ret def;
 }
 
-fn get_type(data: @u8[], def: ast::def_id, tcx: &ty::ctxt,
+fn get_type(data: @[u8], def: ast::def_id, tcx: &ty::ctxt,
             extres: &external_resolver) -> ty::ty_param_kinds_and_ty {
     let this_cnum = def.crate;
     let node_id = def.node;
     let item = lookup_item(node_id, data);
     let t = item_type(item, this_cnum, tcx, extres);
-    let tp_kinds : ast::kind[];
+    let tp_kinds : [ast::kind];
     let fam_ch = item_family(item);
     let has_ty_params = family_has_type_params(fam_ch);
     if has_ty_params {
@@ -212,31 +212,31 @@ fn get_type(data: @u8[], def: ast::def_id, tcx: &ty::ctxt,
     ret {kinds: tp_kinds, ty: t};
 }
 
-fn get_type_param_count(data: @u8[], id: ast::node_id) -> uint {
+fn get_type_param_count(data: @[u8], id: ast::node_id) -> uint {
     ret ivec::len(get_type_param_kinds(data, id));
 }
 
-fn get_type_param_kinds(data: @u8[], id: ast::node_id) -> ast::kind[] {
+fn get_type_param_kinds(data: @[u8], id: ast::node_id) -> [ast::kind] {
     ret item_ty_param_kinds(lookup_item(id, data));
 }
 
-fn get_symbol(data: @u8[], id: ast::node_id) -> str {
+fn get_symbol(data: @[u8], id: ast::node_id) -> str {
     ret item_symbol(lookup_item(id, data));
 }
 
-fn get_tag_variants(data: &@u8[], def: ast::def_id, tcx: &ty::ctxt,
-                    extres: &external_resolver) -> ty::variant_info[] {
+fn get_tag_variants(data: &@[u8], def: ast::def_id, tcx: &ty::ctxt,
+                    extres: &external_resolver) -> [ty::variant_info] {
     let external_crate_id = def.crate;
     let data =
         cstore::get_crate_data(tcx.sess.get_cstore(), external_crate_id).data;
     let items = ebmlivec::get_doc(ebmlivec::new_doc(data), tag_items);
     let item = find_item(def.node, items);
-    let infos: ty::variant_info[] = ~[];
+    let infos: [ty::variant_info] = ~[];
     let variant_ids = tag_variant_ids(item, external_crate_id);
     for did: ast::def_id  in variant_ids {
         let item = find_item(did.node, items);
         let ctor_ty = item_type(item, external_crate_id, tcx, extres);
-        let arg_tys: ty::t[] = ~[];
+        let arg_tys: [ty::t] = ~[];
         alt ty::struct(tcx, ctor_ty) {
           ty::ty_fn(_, args, _, _, _) {
             for a: ty::arg  in args { arg_tys += ~[a.ty]; }
@@ -294,8 +294,8 @@ fn item_family_to_str(fam: u8) -> str {
     }
 }
 
-fn get_meta_items(md: &ebmlivec::doc) -> (@ast::meta_item)[] {
-    let items: (@ast::meta_item)[] = ~[];
+fn get_meta_items(md: &ebmlivec::doc) -> [@ast::meta_item] {
+    let items: [@ast::meta_item] = ~[];
     for each meta_item_doc: ebmlivec::doc  in
              ebmlivec::tagged_docs(md, tag_meta_item_word) {
         let nd = ebmlivec::get_doc(meta_item_doc, tag_meta_item_name);
@@ -322,8 +322,8 @@ fn get_meta_items(md: &ebmlivec::doc) -> (@ast::meta_item)[] {
     ret items;
 }
 
-fn get_attributes(md: &ebmlivec::doc) -> ast::attribute[] {
-    let attrs: ast::attribute[] = ~[];
+fn get_attributes(md: &ebmlivec::doc) -> [ast::attribute] {
+    let attrs: [ast::attribute] = ~[];
     alt ebmlivec::maybe_get_doc(md, tag_attributes) {
       option::some(attrs_d) {
         for each attr_doc: ebmlivec::doc  in
@@ -359,14 +359,14 @@ fn list_crate_attributes(md: &ebmlivec::doc, out: ioivec::writer) {
     out.write_str("\n\n");
 }
 
-fn get_crate_attributes(data: @u8[]) -> ast::attribute[] {
+fn get_crate_attributes(data: @[u8]) -> [ast::attribute] {
     ret get_attributes(ebmlivec::new_doc(data));
 }
 
 type crate_dep = {cnum: ast::crate_num, ident: str};
 
-fn get_crate_deps(data: @u8[]) -> crate_dep[] {
-    let deps: crate_dep[] = ~[];
+fn get_crate_deps(data: @[u8]) -> [crate_dep] {
+    let deps: [crate_dep] = ~[];
     let cratedoc = ebmlivec::new_doc(data);
     let depsdoc = ebmlivec::get_doc(cratedoc, tag_crate_deps);
     let crate_num = 1;
@@ -379,7 +379,7 @@ fn get_crate_deps(data: @u8[]) -> crate_dep[] {
     ret deps;
 }
 
-fn list_crate_deps(data: @u8[], out: ioivec::writer) {
+fn list_crate_deps(data: @[u8], out: ioivec::writer) {
     out.write_str("=External Dependencies=\n");
 
     for dep: crate_dep  in get_crate_deps(data) {
@@ -389,7 +389,7 @@ fn list_crate_deps(data: @u8[], out: ioivec::writer) {
     out.write_str("\n");
 }
 
-fn list_crate_items(bytes: &@u8[], md: &ebmlivec::doc, out: ioivec::writer) {
+fn list_crate_items(bytes: &@[u8], md: &ebmlivec::doc, out: ioivec::writer) {
     out.write_str("=Items=\n");
     let paths = ebmlivec::get_doc(md, tag_paths);
     let items = ebmlivec::get_doc(md, tag_items);
@@ -410,7 +410,7 @@ fn list_crate_items(bytes: &@u8[], md: &ebmlivec::doc, out: ioivec::writer) {
     out.write_str("\n");
 }
 
-fn list_crate_metadata(bytes: &@u8[], out: ioivec::writer) {
+fn list_crate_metadata(bytes: &@[u8], out: ioivec::writer) {
     let md = ebmlivec::new_doc(bytes);
     list_crate_attributes(md, out);
     list_crate_deps(bytes, out);
index 6649cca29a385110056594c02aa2b0b490b0d782..c0af68174532310d5df90d26736f543487ffebfe 100644 (file)
@@ -38,8 +38,8 @@ fn encode_def_id(ebml_w: &ebmlivec::writer, id: &def_id) {
 
 type entry[T] = {val: T, pos: uint};
 
-fn encode_tag_variant_paths(ebml_w: &ebmlivec::writer, variants: &variant[],
-                            path: &str[], index: &mutable (entry[str])[]) {
+fn encode_tag_variant_paths(ebml_w: &ebmlivec::writer, variants: &[variant],
+                            path: &[str], index: &mutable [entry[str]]) {
     for variant: variant  in variants {
         add_to_index(ebml_w, path, index, variant.node.name);
         ebmlivec::start_tag(ebml_w, tag_paths_data_item);
@@ -49,8 +49,8 @@ fn encode_tag_variant_paths(ebml_w: &ebmlivec::writer, variants: &variant[],
     }
 }
 
-fn add_to_index(ebml_w: &ebmlivec::writer, path: &str[],
-                index: &mutable (entry[str])[], name: &str) {
+fn add_to_index(ebml_w: &ebmlivec::writer, path: &[str],
+                index: &mutable [entry[str]], name: &str) {
     let full_path = path + ~[name];
     index +=
         ~[{val: str::connect_ivec(full_path, "::"),
@@ -58,8 +58,8 @@ fn add_to_index(ebml_w: &ebmlivec::writer, path: &str[],
 }
 
 fn encode_native_module_item_paths(ebml_w: &ebmlivec::writer,
-                                   nmod: &native_mod, path: &str[],
-                                   index: &mutable (entry[str])[]) {
+                                   nmod: &native_mod, path: &[str],
+                                   index: &mutable [entry[str]]) {
     for nitem: @native_item  in nmod.items {
         add_to_index(ebml_w, path, index, nitem.ident);
         ebmlivec::start_tag(ebml_w, tag_paths_data_item);
@@ -70,7 +70,7 @@ fn encode_native_module_item_paths(ebml_w: &ebmlivec::writer,
 }
 
 fn encode_module_item_paths(ebml_w: &ebmlivec::writer, module: &_mod,
-                            path: &str[], index: &mutable (entry[str])[]) {
+                            path: &[str], index: &mutable [entry[str]]) {
     for it: @item  in module.items {
         if !is_exported(it.ident, module) { cont; }
         alt it.node {
@@ -149,9 +149,9 @@ fn encode_module_item_paths(ebml_w: &ebmlivec::writer, module: &_mod,
 }
 
 fn encode_item_paths(ebml_w: &ebmlivec::writer, crate: &@crate) ->
-   (entry[str])[] {
-    let index: (entry[str])[] = ~[];
-    let path: str[] = ~[];
+   [entry[str]] {
+    let index: [entry[str]] = ~[];
+    let path: [str] = ~[];
     ebmlivec::start_tag(ebml_w, tag_paths);
     encode_module_item_paths(ebml_w, crate.node.module, path, index);
     ebmlivec::end_tag(ebml_w);
@@ -174,7 +174,7 @@ fn encode_inlineness(ebml_w: &ebmlivec::writer, c: u8) {
 
 fn def_to_str(did: &def_id) -> str { ret #fmt("%d:%d", did.crate, did.node); }
 
-fn encode_type_param_kinds(ebml_w: &ebmlivec::writer, tps: &ty_param[]) {
+fn encode_type_param_kinds(ebml_w: &ebmlivec::writer, tps: &[ty_param]) {
     ebmlivec::start_tag(ebml_w, tag_items_data_item_ty_param_kinds);
     ebmlivec::write_vint(ebml_w.writer, ivec::len[ty_param](tps));
     for tp: ty_param in tps {
@@ -225,9 +225,9 @@ fn encode_tag_id(ebml_w: &ebmlivec::writer, id: &def_id) {
 }
 
 fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer,
-                           id: node_id, variants: &variant[],
-                           index: &mutable (entry[int])[],
-                           ty_params: &ty_param[]) {
+                           id: node_id, variants: &[variant],
+                           index: &mutable [entry[int]],
+                           ty_params: &[ty_param]) {
     for variant: variant  in variants {
         index += ~[{val: variant.node.id, pos: ebml_w.writer.tell()}];
         ebmlivec::start_tag(ebml_w, tag_items_data_item);
@@ -246,7 +246,7 @@ fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer,
 }
 
 fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebmlivec::writer,
-                        item: @item, index: &mutable (entry[int])[]) {
+                        item: @item, index: &mutable [entry[int]]) {
     alt item.node {
       item_const(_, _) {
         ebmlivec::start_tag(ebml_w, tag_items_data_item);
@@ -368,8 +368,8 @@ fn encode_info_for_native_item(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer,
 }
 
 fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer) ->
-   (entry[int])[] {
-    let index: (entry[int])[] = ~[];
+   [entry[int]] {
+    let index: [entry[int]] = ~[];
     ebmlivec::start_tag(ebml_w, tag_items_data);
     for each kvp: @{key: node_id, val: middle::ast_map::ast_node}  in
              ecx.ccx.ast_map.items() {
@@ -392,9 +392,9 @@ fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebmlivec::writer) ->
 
 // Path and definition ID indexing
 
-fn create_index[T](index: &(entry[T])[], hash_fn: fn(&T) -> uint ) ->
-   (@(entry[T])[])[] {
-    let buckets: (@mutable (entry[T])[])[] = ~[];
+fn create_index[T](index: &[entry[T]], hash_fn: fn(&T) -> uint ) ->
+   [@[entry[T]]] {
+    let buckets: [@mutable [entry[T]]] = ~[];
     for each i: uint  in uint::range(0u, 256u) { buckets += ~[@mutable ~[]]; }
     for elt: entry[T]  in index {
         let h = hash_fn(elt.val);
@@ -402,19 +402,19 @@ fn create_index[T](index: &(entry[T])[], hash_fn: fn(&T) -> uint ) ->
     }
 
     let buckets_frozen = ~[];
-    for bucket: @mutable (entry[T])[]  in buckets {
+    for bucket: @mutable [entry[T]]  in buckets {
         buckets_frozen += ~[@*bucket];
     }
     ret buckets_frozen;
 }
 
-fn encode_index[T](ebml_w: &ebmlivec::writer, buckets: &(@(entry[T])[])[],
+fn encode_index[T](ebml_w: &ebmlivec::writer, buckets: &[@[entry[T]]],
                    write_fn: fn(&ioivec::writer, &T) ) {
     let writer = ioivec::new_writer_(ebml_w.writer);
     ebmlivec::start_tag(ebml_w, tag_index);
-    let bucket_locs: uint[] = ~[];
+    let bucket_locs: [uint] = ~[];
     ebmlivec::start_tag(ebml_w, tag_index_buckets);
-    for bucket: @(entry[T])[]  in buckets {
+    for bucket: @[entry[T]]  in buckets {
         bucket_locs += ~[ebml_w.writer.tell()];
         ebmlivec::start_tag(ebml_w, tag_index_buckets_bucket);
         for elt: entry[T]  in *bucket {
@@ -475,7 +475,7 @@ fn encode_meta_item(ebml_w: &ebmlivec::writer, mi: &meta_item) {
     }
 }
 
-fn encode_attributes(ebml_w: &ebmlivec::writer, attrs: &attribute[]) {
+fn encode_attributes(ebml_w: &ebmlivec::writer, attrs: &[attribute]) {
     ebmlivec::start_tag(ebml_w, tag_attributes);
     for attr: attribute  in attrs {
         ebmlivec::start_tag(ebml_w, tag_attribute);
@@ -489,9 +489,9 @@ fn encode_attributes(ebml_w: &ebmlivec::writer, attrs: &attribute[]) {
 // metadata that Rust cares about for linking crates. This attribute requires
 // 'name' and 'vers' items, so if the user didn't provide them we will throw
 // them in anyway with default values.
-fn synthesize_crate_attrs(ecx: &@encode_ctxt, crate: &@crate) -> attribute[] {
+fn synthesize_crate_attrs(ecx: &@encode_ctxt, crate: &@crate) -> [attribute] {
 
-    fn synthesize_link_attr(ecx: &@encode_ctxt, items: &(@meta_item)[]) ->
+    fn synthesize_link_attr(ecx: &@encode_ctxt, items: &[@meta_item]) ->
        attribute {
 
         assert (ecx.ccx.link_meta.name != "");
@@ -514,7 +514,7 @@ fn synthesize_link_attr(ecx: &@encode_ctxt, items: &(@meta_item)[]) ->
         ret attr::mk_attr(link_item);
     }
 
-    let attrs: attribute[] = ~[];
+    let attrs: [attribute] = ~[];
     let found_link_attr = false;
     for attr: attribute  in crate.node.attrs {
         attrs +=
@@ -538,12 +538,12 @@ fn synthesize_link_attr(ecx: &@encode_ctxt, items: &(@meta_item)[]) ->
 
 fn encode_crate_deps(ebml_w: &ebmlivec::writer, cstore: &cstore::cstore) {
 
-    fn get_ordered_names(cstore: &cstore::cstore) -> str[] {
+    fn get_ordered_names(cstore: &cstore::cstore) -> [str] {
         type hashkv = @{key: crate_num, val: cstore::crate_metadata};
         type numname = {crate: crate_num, ident: str};
 
         // Pull the cnums and names out of cstore
-        let pairs: numname[mutable ] = ~[mutable ];
+        let pairs: [mutable numname] = ~[mutable];
         for each hashkv: hashkv  in cstore::iter_crate_data(cstore) {
             pairs += ~[mutable {crate: hashkv.key, ident: hashkv.val.name}];
         }
index 093c2a7bebab0e71041fb50829145e3b944c8331..1ff547c0a4dc6b01a90559bf544fae1bb7d9f6ae 100644 (file)
@@ -22,7 +22,7 @@
 type str_def = fn(str) -> ast::def_id ;
 
 type pstate =
-    {data: @u8[], crate: int, mutable pos: uint, len: uint, tcx: ty::ctxt};
+    {data: @[u8], crate: int, mutable pos: uint, len: uint, tcx: ty::ctxt};
 
 tag ty_or_bang { a_ty(ty::t); a_bang; }
 
@@ -49,7 +49,7 @@ fn parse_ident_(st: @pstate, sd: str_def, is_last: fn(char) -> bool ) ->
 }
 
 
-fn parse_ty_data(data: @u8[], crate_num: int, pos: uint, len: uint,
+fn parse_ty_data(data: @[u8], crate_num: int, pos: uint, len: uint,
                  sd: str_def, tcx: ty::ctxt) -> ty::t {
     let st =
         @{data: data, crate: crate_num, mutable pos: pos, len: len, tcx: tcx};
@@ -64,8 +64,8 @@ fn parse_ty_or_bang(st: @pstate, sd: str_def) -> ty_or_bang {
     }
 }
 
-fn parse_constrs(st: @pstate, sd: str_def) -> (@ty::constr)[] {
-    let rslt: (@ty::constr)[] = ~[];
+fn parse_constrs(st: @pstate, sd: str_def) -> [@ty::constr] {
+    let rslt: [@ty::constr] = ~[];
     alt peek(st) as char {
       ':' {
         do  {
@@ -81,8 +81,8 @@ fn parse_constrs(st: @pstate, sd: str_def) -> (@ty::constr)[] {
 }
 
 // FIXME less copy-and-paste
-fn parse_ty_constrs(st: @pstate, sd: str_def) -> (@ty::type_constr)[] {
-    let rslt: (@ty::type_constr)[] = ~[];
+fn parse_ty_constrs(st: @pstate, sd: str_def) -> [@ty::type_constr] {
+    let rslt: [@ty::type_constr] = ~[];
     alt peek(st) as char {
       ':' {
         do  {
@@ -98,7 +98,7 @@ fn parse_ty_constrs(st: @pstate, sd: str_def) -> (@ty::type_constr)[] {
 }
 
 fn parse_path(st: @pstate, sd: str_def) -> ast::path {
-    let idents: ast::ident[] = ~[];
+    let idents: [ast::ident] = ~[];
     fn is_last(c: char) -> bool { ret c == '(' || c == ':'; }
     idents += ~[parse_ident_(st, sd, is_last)];
     while true {
@@ -153,7 +153,7 @@ fn parse_ty_constr_arg(st: @pstate, sd: str_def) ->
 fn parse_constr[@T](st: @pstate, sd: str_def, pser: arg_parser[T]) ->
    @ty::constr_general[T] {
     let sp = {lo: 0u, hi: 0u}; // FIXME: use a real span
-    let args: (@sp_constr_arg[T])[] = ~[];
+    let args: [@sp_constr_arg[T]] = ~[];
     let pth: path = parse_path(st, sd);
     let ignore: char = next(st) as char;
     assert (ignore as char == '(');
@@ -197,7 +197,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
       't' {
         assert (next(st) as char == '[');
         let def = parse_def(st, sd);
-        let params: ty::t[] = ~[];
+        let params: [ty::t] = ~[];
         while peek(st) as char != ']' { params += ~[parse_ty(st, sd)]; }
         st.pos = st.pos + 1u;
         ret ty::mk_tag(st.tcx, def, params);
@@ -223,7 +223,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
       'C' { ret ty::mk_chan(st.tcx, parse_ty(st, sd)); }
       'R' {
         assert (next(st) as char == '[');
-        let fields: ty::field[] = ~[];
+        let fields: [ty::field] = ~[];
         while peek(st) as char != ']' {
             let name = "";
             while peek(st) as char != '=' {
@@ -264,7 +264,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
       }
       'O' {
         assert (next(st) as char == '[');
-        let methods: ty::method[] = ~[];
+        let methods: [ty::method] = ~[];
         while peek(st) as char != ']' {
             let proto;
             alt next(st) as char {
@@ -291,7 +291,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
         assert (next(st) as char == '[');
         let def = parse_def(st, sd);
         let inner = parse_ty(st, sd);
-        let params: ty::t[] = ~[];
+        let params: [ty::t] = ~[];
         while peek(st) as char != ']' { params += ~[parse_ty(st, sd)]; }
         st.pos = st.pos + 1u;
         ret ty::mk_res(st.tcx, def, inner, params);
@@ -369,9 +369,9 @@ fn parse_hex(st: @pstate) -> uint {
 }
 
 fn parse_ty_fn(st: @pstate, sd: str_def) ->
-   {args: ty::arg[], ty: ty::t, cf: ast::controlflow, cs: (@ty::constr)[]} {
+   {args: [ty::arg], ty: ty::t, cf: ast::controlflow, cs: [@ty::constr]} {
     assert (next(st) as char == '[');
-    let inputs: ty::arg[] = ~[];
+    let inputs: [ty::arg] = ~[];
     while peek(st) as char != ']' {
         let mode = ty::mo_val;
         if peek(st) as char == '&' {
@@ -399,7 +399,7 @@ fn parse_ty_fn(st: @pstate, sd: str_def) ->
 
 
 // Rust metadata parsing
-fn parse_def_id(buf: &u8[]) -> ast::def_id {
+fn parse_def_id(buf: &[u8]) -> ast::def_id {
     let colon_idx = 0u;
     let len = ivec::len[u8](buf);
     while colon_idx < len && buf.(colon_idx) != ':' as u8 { colon_idx += 1u; }
index 2781a7dc6a30accde8a1c064badf79d79893e43b..529c51f602ff672ab067efc04482972dbc192510 100644 (file)
@@ -199,8 +199,8 @@ fn enc_proto(w: &ioivec::writer, proto: proto) {
     }
 }
 
-fn enc_ty_fn(w: &ioivec::writer, cx: &@ctxt, args: &ty::arg[], out: &ty::t,
-             cf: &controlflow, constrs: &(@ty::constr)[]) {
+fn enc_ty_fn(w: &ioivec::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
+             cf: &controlflow, constrs: &[@ty::constr]) {
     w.write_char('[');
     for arg: ty::arg  in args {
         alt arg.mode {
index d6aca1cf36c04773bab7cfb762f3601b1d834c01..2eefe1c9f5d214100fc22d0fa7a6158a559a48b2 100644 (file)
 tag valid { valid; overwritten(span, ast::path); val_taken(span, ast::path); }
 
 type restrict =
-    @{root_vars: node_id[],
+    @{root_vars: [node_id],
       block_defnum: node_id,
-      bindings: node_id[],
-      tys: ty::t[],
-      depends_on: uint[],
+      bindings: [node_id],
+      tys: [ty::t],
+      depends_on: [uint],
       mutable ok: valid};
 
-type scope = @restrict[];
+type scope = @[restrict];
 
 tag local_info { arg(ast::mode); objfield(ast::mutability); }
 
@@ -51,7 +51,7 @@ fn check_crate(tcx: ty::ctxt, crate: &@ast::crate) {
     tcx.sess.abort_if_errors();
 }
 
-fn visit_fn(cx: &@ctx, f: &ast::_fn, tp: &ast::ty_param[], sp: &span,
+fn visit_fn(cx: &@ctx, f: &ast::_fn, tp: &[ast::ty_param], sp: &span,
             name: &fn_ident, id: ast::node_id, sc: &scope, v: &vt[scope]) {
     visit::visit_fn_decl(f.decl, sc, v);
     for arg_: ast::arg  in f.decl.inputs {
@@ -164,14 +164,14 @@ fn visit_decl(cx: &@ctx, d: &@ast::decl, sc: &scope, v: &vt[scope]) {
     }
 }
 
-fn check_call(cx: &ctx, f: &@ast::expr, args: &(@ast::expr)[], sc: &scope) ->
-   {root_vars: node_id[], unsafe_ts: ty::t[]} {
+fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
+   {root_vars: [node_id], unsafe_ts: [ty::t]} {
     let fty = ty::expr_ty(cx.tcx, f);
     let arg_ts = fty_args(cx, fty);
-    let roots: node_id[] = ~[];
-    let mut_roots: {arg: uint, node: node_id}[] = ~[];
-    let unsafe_ts: ty::t[] = ~[];
-    let unsafe_t_offsets: uint[] = ~[];
+    let roots: [node_id] = ~[];
+    let mut_roots: [{arg: uint, node: node_id}] = ~[];
+    let unsafe_ts: [ty::t] = ~[];
+    let unsafe_t_offsets: [uint] = ~[];
     let i = 0u;
     for arg_t: ty::arg  in arg_ts {
         if arg_t.mode != ty::mo_val {
@@ -308,13 +308,13 @@ fn check_tail_call(cx: &ctx, call: &@ast::expr) {
     }
 }
 
-fn check_alt(cx: &ctx, input: &@ast::expr, arms: &ast::arm[], sc: &scope,
+fn check_alt(cx: &ctx, input: &@ast::expr, arms: &[ast::arm], sc: &scope,
              v: &vt[scope]) {
     visit::visit_expr(input, sc, v);
     let root = expr_root(cx, input, true);
     let roots =
         alt path_def_id(cx, root.ex) { some(did) { ~[did.node] } _ { ~[] } };
-    let forbidden_tp: ty::t[] =
+    let forbidden_tp: [ty::t] =
         alt inner_mut(root.ds) { some(t) { ~[t] } _ { ~[] } };
     for a: ast::arm  in arms {
         let dnums = arm_defnums(a);
@@ -331,7 +331,7 @@ fn check_alt(cx: &ctx, input: &@ast::expr, arms: &ast::arm[], sc: &scope,
     }
 }
 
-fn arm_defnums(arm: &ast::arm) -> node_id[] {
+fn arm_defnums(arm: &ast::arm) -> [node_id] {
     ret ast::pat_binding_ids(arm.pats.(0));
 }
 
@@ -506,7 +506,7 @@ fn test_scope(cx: &ctx, sc: &scope, r: &restrict, p: &ast::path) {
     }
 }
 
-fn deps(sc: &scope, roots: &node_id[]) -> uint[] {
+fn deps(sc: &scope, roots: &[node_id]) -> [uint] {
     let i = 0u;
     let result = ~[];
     for r: restrict  in *sc {
@@ -528,8 +528,8 @@ fn deps(sc: &scope, roots: &node_id[]) -> uint[] {
 // the inner derefs come in front, so foo.bar.baz becomes rec(ex=foo,
 // ds=[field(baz),field(bar)])
 fn expr_root(cx: &ctx, ex: @ast::expr, autoderef: bool) ->
-   {ex: @ast::expr, ds: @deref[]} {
-    fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: deref[]} {
+   {ex: @ast::expr, ds: @[deref]} {
+    fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: [deref]} {
         let ds = ~[];
         while true {
             alt ty::struct(cx.tcx, t) {
@@ -557,7 +557,7 @@ fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: deref[]} {
         }
         ret {t: t, ds: ds};
     }
-    let ds: deref[] = ~[];
+    let ds: [deref] = ~[];
     while true {
         alt { ex.node } {
           ast::expr_field(base, ident) {
@@ -621,12 +621,12 @@ fn maybe_auto_unbox(cx: &ctx, t: ty::t) -> {t: ty::t, ds: deref[]} {
     ret {ex: ex, ds: @ds};
 }
 
-fn mut_field(ds: &@deref[]) -> bool {
+fn mut_field(ds: &@[deref]) -> bool {
     for d: deref  in *ds { if d.mut { ret true; } }
     ret false;
 }
 
-fn inner_mut(ds: &@deref[]) -> option::t[ty::t] {
+fn inner_mut(ds: &@[deref]) -> option::t[ty::t] {
     for d: deref  in *ds { if d.mut { ret some(d.outer_t); } }
     ret none;
 }
@@ -701,7 +701,7 @@ fn def_is_local(d: &ast::def, objfields_count: bool) -> bool {
         };
 }
 
-fn fty_args(cx: &ctx, fty: ty::t) -> ty::arg[] {
+fn fty_args(cx: &ctx, fty: ty::t) -> [ty::arg] {
     ret alt ty::struct(cx.tcx, ty::type_autoderef(cx.tcx, fty)) {
           ty::ty_fn(_, args, _, _, _) | ty::ty_native_fn(_, args, _) { args }
         };
index c0053ecc56d886f9b930417bf33b34ce567c417d..b3feeeb3fecd8940c3ced376c6a93609c3d9bad2 100644 (file)
@@ -15,7 +15,7 @@ fn check_expr(tcx: &ty::ctxt, ex: &@expr, s: &(), v: &visit::vt[()]) {
     alt ex.node { expr_alt(_, arms) { check_arms(tcx, arms); } _ { } }
 }
 
-fn check_arms(tcx: &ty::ctxt, arms: &arm[]) {
+fn check_arms(tcx: &ty::ctxt, arms: &[arm]) {
     let i = 0;
     for arm: arm  in arms {
         for arm_pat: @pat  in arm.pats {
@@ -38,7 +38,7 @@ fn check_arms(tcx: &ty::ctxt, arms: &arm[]) {
 }
 
 fn pattern_supersedes(tcx: &ty::ctxt, a: &@pat, b: &@pat) -> bool {
-    fn patterns_supersede(tcx: &ty::ctxt, as: &(@pat)[], bs: &(@pat)[]) ->
+    fn patterns_supersede(tcx: &ty::ctxt, as: &[@pat], bs: &[@pat]) ->
        bool {
         let i = 0;
         for a: @pat  in as {
@@ -47,8 +47,8 @@ fn patterns_supersede(tcx: &ty::ctxt, as: &(@pat)[], bs: &(@pat)[]) ->
         }
         ret true;
     }
-    fn field_patterns_supersede(tcx: &ty::ctxt, fas: &field_pat[],
-                                fbs: &field_pat[]) -> bool {
+    fn field_patterns_supersede(tcx: &ty::ctxt, fas: &[field_pat],
+                                fbs: &[field_pat]) -> bool {
         let wild = @{id: 0, node: pat_wild, span: {lo: 0u, hi: 0u}};
         for fa: field_pat  in fas {
             let pb = wild;
index 4b3ac5739dd3c230f60e2d2928c9ca8d619d6861..fa1cc2aa093469f0bbd12f597872d7c4809d0445 100644 (file)
@@ -30,7 +30,7 @@
 // testing membership, the list of referencing sites is what you want for most
 // other things.
 type freevar_set = hashset[ast::node_id];
-type freevar_info = {defs: freevar_set, refs: @ast::node_id[]};
+type freevar_info = {defs: freevar_set, refs: @[ast::node_id]};
 type freevar_map = hashmap[ast::node_id, freevar_info];
 
 // Searches through part of the AST for all references to locals or
 // in order to start the search.
 fn collect_freevars(def_map: &resolve::def_map, sess: &session::session,
                     walker: &fn(&visit::vt[()]) ,
-                    initial_decls: ast::node_id[]) -> freevar_info {
+                    initial_decls: [ast::node_id]) -> freevar_info {
     let decls = new_int_hash();
     for decl: ast::node_id  in initial_decls { set_add(decls, decl); }
     let refs = @mutable ~[];
 
-    let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], sp: &span,
+    let walk_fn = lambda(f: &ast::_fn, tps: &[ast::ty_param], sp: &span,
                          i: &ast::fn_ident, nid: ast::node_id) {
         for a: ast::arg  in f.decl.inputs { set_add(decls, a.id); }
     };
@@ -107,7 +107,7 @@ fn annotate_freevars(sess: &session::session, def_map: &resolve::def_map,
                      crate: &@ast::crate) -> freevar_map {
     let freevars = new_int_hash();
 
-    let walk_fn = lambda(f: &ast::_fn, tps: &ast::ty_param[], sp: &span,
+    let walk_fn = lambda(f: &ast::_fn, tps: &[ast::ty_param], sp: &span,
                          i: &ast::fn_ident, nid: ast::node_id) {
         let start_walk = lambda(v: &visit::vt[()]) {
             v.visit_fn(f, tps, sp, i, nid, (), v);
@@ -148,7 +148,7 @@ fn get_freevar_info(tcx: &ty::ctxt, fid: ast::node_id) -> freevar_info {
 fn get_freevar_defs(tcx: &ty::ctxt, fid: ast::node_id) -> freevar_set {
     ret get_freevar_info(tcx, fid).defs;
 }
-fn get_freevars(tcx: &ty::ctxt, fid: ast::node_id) -> @ast::node_id[] {
+fn get_freevars(tcx: &ty::ctxt, fid: ast::node_id) -> @[ast::node_id] {
     ret get_freevar_info(tcx, fid).refs;
 }
 fn has_freevars(tcx: &ty::ctxt, fid: ast::node_id) -> bool {
index 5aa955e7c44f05fec9d7bae1dc562c896e9151fe..d1e9236d035bf6fc68ff4862813bb41a3958e0fd 100644 (file)
@@ -49,7 +49,7 @@
 tag scope {
     scope_crate;
     scope_item(@ast::item);
-    scope_fn(ast::fn_decl, ast::proto, ast::ty_param[]);
+    scope_fn(ast::fn_decl, ast::proto, [ast::ty_param]);
     scope_native_item(@ast::native_item);
     scope_loop(@ast::local); // there's only 1 decl per loop.
 
@@ -104,7 +104,7 @@ fn eq(v1: &key, v2: &key) -> bool {
 type indexed_mod =
     {m: option::t[ast::_mod],
      index: mod_index,
-     mutable glob_imports: glob_imp_def[],
+     mutable glob_imports: [glob_imp_def],
      glob_imported_names: hashmap[str, import_state]};
 
 
@@ -119,9 +119,9 @@ fn eq(v1: &key, v2: &key) -> bool {
      ast_map: ast_map::map,
      imports: hashmap[ast::node_id, import_state],
      mod_map: hashmap[ast::node_id, @indexed_mod],
-     ext_map: hashmap[def_id, ident[]],
+     ext_map: hashmap[def_id, [ident]],
      ext_cache: ext_hash,
-     mutable reported: {ident: str, sc: scope}[],
+     mutable reported: [{ident: str, sc: scope}],
      sess: session};
 
 
@@ -139,7 +139,7 @@ fn resolve_crate(sess: session, amap: &ast_map::map, crate: @ast::crate) ->
           ast_map: amap,
           imports: new_int_hash[import_state](),
           mod_map: new_int_hash[@indexed_mod](),
-          ext_map: new_def_hash[ident[]](),
+          ext_map: new_def_hash[[ident]](),
           ext_cache: new_ext_hash(),
           mutable reported: ~[],
           sess: sess};
@@ -327,7 +327,7 @@ fn visit_native_item_with_scope(ni: &@ast::native_item, sc: &scopes,
     visit::visit_native_item(ni, cons(scope_native_item(ni), @sc), v);
 }
 
-fn visit_fn_with_scope(e: &@env, f: &ast::_fn, tp: &ast::ty_param[],
+fn visit_fn_with_scope(e: &@env, f: &ast::_fn, tp: &[ast::ty_param],
                        sp: &span, name: &fn_ident, id: node_id, sc: &scopes,
                        v: &vt[scopes]) {
     // is this a main fn declaration?
@@ -375,7 +375,7 @@ fn visit_expr_with_scope(x: &@ast::expr, sc: &scopes, v: &vt[scopes]) {
     }
 }
 
-fn follow_import(e: &env, sc: &scopes, path: &ident[], sp: &span) ->
+fn follow_import(e: &env, sc: &scopes, path: &[ident], sp: &span) ->
    option::t[def] {
     let path_len = ivec::len(path);
     let dcur = lookup_in_scope_strict(e, sc, sp, path.(0), ns_module);
@@ -701,7 +701,7 @@ fn in_scope(e: &env, sp: &span, name: &ident, s: &scope, ns: namespace) ->
 
 }
 
-fn lookup_in_ty_params(name: &ident, ty_params: &ast::ty_param[]) ->
+fn lookup_in_ty_params(name: &ident, ty_params: &[ast::ty_param]) ->
    option::t[def] {
     let i = 0u;
     for tp: ast::ty_param  in ty_params {
@@ -738,7 +738,7 @@ fn lookup_in_pat(name: &ident, pat: &ast::pat) -> option::t[def_id] {
 }
 
 fn lookup_in_fn(name: &ident, decl: &ast::fn_decl,
-                ty_params: &ast::ty_param[], ns: namespace) ->
+                ty_params: &[ast::ty_param], ns: namespace) ->
    option::t[def] {
     alt ns {
       ns_value. {
@@ -754,7 +754,7 @@ fn lookup_in_fn(name: &ident, decl: &ast::fn_decl,
     }
 }
 
-fn lookup_in_obj(name: &ident, ob: &ast::_obj, ty_params: &ast::ty_param[],
+fn lookup_in_obj(name: &ident, ob: &ast::_obj, ty_params: &[ast::ty_param],
                  ns: namespace) -> option::t[def] {
     alt ns {
       ns_value. {
@@ -1138,7 +1138,7 @@ fn ns_for_def(d: def) -> namespace {
         };
 }
 
-fn lookup_external(e: &env, cnum: int, ids: &ident[], ns: namespace) ->
+fn lookup_external(e: &env, cnum: int, ids: &[ident], ns: namespace) ->
    option::t[def] {
     for d: def  in csearch::lookup_defs(e.sess.get_cstore(), cnum, ids) {
         e.ext_map.insert(ast::def_id_of_def(d), ids);
@@ -1211,8 +1211,8 @@ fn mie_span(mie: &mod_index_entry) -> span {
 }
 
 fn check_item(e: &@env, i: &@ast::item, x: &(), v: &vt[()]) {
-    fn typaram_names(tps: &ast::ty_param[]) -> ident[] {
-        let x: ast::ident[] = ~[];
+    fn typaram_names(tps: &[ast::ty_param]) -> [ident] {
+        let x: [ast::ident] = ~[];
         for tp: ast::ty_param in tps { x += ~[tp.ident] }
         ret x;
     }
@@ -1347,10 +1347,10 @@ fn check_ty(e: &@env, ty: &@ast::ty, x: &(), v: &vt[()]) {
     visit::visit_ty(ty, x, v);
 }
 
-type checker = @{mutable seen: ident[], kind: str, sess: session};
+type checker = @{mutable seen: [ident], kind: str, sess: session};
 
 fn checker(e: &env, kind: str) -> checker {
-    let seen: ident[] = ~[];
+    let seen: [ident] = ~[];
     ret @{mutable seen: seen, kind: kind, sess: e.sess};
 }
 
@@ -1365,7 +1365,7 @@ fn add_name(ch: &checker, sp: &span, name: &ident) {
 
 fn ident_id(i: &ident) -> ident { ret i; }
 
-fn ensure_unique[T](e: &env, sp: &span, elts: &T[], id: fn(&T) -> ident ,
+fn ensure_unique[T](e: &env, sp: &span, elts: &[T], id: fn(&T) -> ident ,
                     kind: &str) {
     let ch = checker(e, kind);
     for elt: T  in elts { add_name(ch, sp, id(elt)); }
index fb06d28d29898b7642dd124efb2a61dde9db4b13..459129238891e5ced5664bde2fc81ead93a479cd 100644 (file)
@@ -39,7 +39,7 @@
     mutable next_tag_id: u16,
     pad: u16,
     tag_id_to_index: hashmap[ast::def_id,u16],
-    mutable tag_order: ast::def_id[],
+    mutable tag_order: [ast::def_id],
     resources: interner::interner[res_info],
     llshapetablesty: TypeRef,
     llshapetables: ValueRef
@@ -102,7 +102,7 @@ fn mk_global(ccx : &@crate_ctxt, name : &str, llval : ValueRef) -> ValueRef {
 //
 // TODO: Use this in dynamic_size_of() as well.
 
-fn largest_variants(ccx : &@crate_ctxt, tag_id : &ast::def_id) -> uint[] {
+fn largest_variants(ccx : &@crate_ctxt, tag_id : &ast::def_id) -> [uint] {
     // Compute the minimum and maximum size and alignment for each variant.
     //
     // TODO: We could do better here; e.g. we know that any variant that
@@ -186,7 +186,7 @@ fn round_up(size : u16, align : u8) -> u16 {
 
 type size_align = { size: u16, align: u8 };
 
-fn compute_static_tag_size(ccx : &@crate_ctxt, largest_variants : &uint[],
+fn compute_static_tag_size(ccx : &@crate_ctxt, largest_variants : &[uint],
                            did : &ast::def_id) -> size_align {
     let max_size = 0u16; let max_align = 1u8;
     let variants = ty::tag_variants(ccx.tcx, did);
@@ -263,20 +263,20 @@ fn mk_ctxt(llmod : ModuleRef) -> ctxt {
     };
 }
 
-fn add_bool(dest : &mutable u8[], val : bool) {
+fn add_bool(dest : &mutable [u8], val : bool) {
     dest += ~[if val { 1u8 } else { 0u8 }];
 }
 
-fn add_u16(dest : &mutable u8[], val : u16) {
+fn add_u16(dest : &mutable [u8], val : u16) {
     dest += ~[(val & 0xffu16) as u8, (val >> 8u16) as u8];
 }
 
-fn add_substr(dest : &mutable u8[], src : &u8[]) {
+fn add_substr(dest : &mutable [u8], src : &[u8]) {
     add_u16(dest, ivec::len(src) as u16);
     dest += src;
 }
 
-fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> u8[] {
+fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> [u8] {
     let s = ~[];
 
     alt ty::struct(ccx.tcx, t) {
@@ -395,7 +395,7 @@ fn shape_of(ccx : &@crate_ctxt, t : ty::t) -> u8[] {
     ret s;
 }
 
-fn add_size_hint(ccx : &@crate_ctxt, s : &mutable u8[], typ : ty::t) {
+fn add_size_hint(ccx : &@crate_ctxt, s : &mutable [u8], typ : ty::t) {
     if (ty::type_has_dynamic_size(ccx.tcx, typ)) {
         s += ~[ 0u8, 0u8, 0u8 ];
         ret;
@@ -407,7 +407,7 @@ fn add_size_hint(ccx : &@crate_ctxt, s : &mutable u8[], typ : ty::t) {
 }
 
 // FIXME: We might discover other variants as we traverse these. Handle this.
-fn shape_of_variant(ccx : &@crate_ctxt, v : &ty::variant_info) -> u8[] {
+fn shape_of_variant(ccx : &@crate_ctxt, v : &ty::variant_info) -> [u8] {
     let s = ~[];
     for t : ty::t in v.args { s += shape_of(ccx, t); }
     ret s;
index f58c4b65734d0d61283636f8486102832e8c47aa..2d003182cb2b29426aa6087445b1a89d63e075e9 100644 (file)
@@ -88,9 +88,9 @@ fn type_of(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
     ret type_of_inner(cx, sp, t);
 }
 
-fn type_of_explicit_args(cx: &@crate_ctxt, sp: &span, inputs: &ty::arg[]) ->
-   TypeRef[] {
-    let atys: TypeRef[] = ~[];
+fn type_of_explicit_args(cx: &@crate_ctxt, sp: &span, inputs: &[ty::arg]) ->
+   [TypeRef] {
+    let atys: [TypeRef] = ~[];
     for arg: ty::arg  in inputs {
         let t: TypeRef = type_of_inner(cx, sp, arg.ty);
         t = alt arg.mode {
@@ -111,9 +111,9 @@ fn type_of_explicit_args(cx: &@crate_ctxt, sp: &span, inputs: &ty::arg[]) ->
 //  - new_fn_ctxt
 //  - trans_args
 fn type_of_fn_full(cx: &@crate_ctxt, sp: &span, proto: ast::proto,
-                   is_method: bool, inputs: &ty::arg[], output: &ty::t,
+                   is_method: bool, inputs: &[ty::arg], output: &ty::t,
                    ty_param_count: uint) -> TypeRef {
-    let atys: TypeRef[] = ~[];
+    let atys: [TypeRef] = ~[];
 
     // Arg 0: Output pointer.
     atys += ~[T_ptr(type_of_inner(cx, sp, output))];
@@ -148,7 +148,7 @@ fn type_of_fn_full(cx: &@crate_ctxt, sp: &span, proto: ast::proto,
 }
 
 fn type_of_fn(cx: &@crate_ctxt, sp: &span, proto: ast::proto,
-              inputs: &ty::arg[], output: &ty::t, ty_param_count: uint) ->
+              inputs: &[ty::arg], output: &ty::t, ty_param_count: uint) ->
    TypeRef {
     ret type_of_fn_full(cx, sp, proto, false, inputs, output, ty_param_count);
 }
@@ -164,9 +164,9 @@ fn type_of_fn_from_ty(cx: &@crate_ctxt, sp: &span,
 }
 
 fn type_of_native_fn(cx: &@crate_ctxt, sp: &span, abi: ast::native_abi,
-                     inputs: &ty::arg[], output: &ty::t, ty_param_count: uint)
+                     inputs: &[ty::arg], output: &ty::t, ty_param_count: uint)
    -> TypeRef {
-    let atys: TypeRef[] = ~[];
+    let atys: [TypeRef] = ~[];
     if abi == ast::native_abi_rust {
         atys += ~[T_taskptr(*cx)];
         let i = 0u;
@@ -225,7 +225,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
       ty::ty_chan(t) { llty = T_ptr(T_chan(type_of_inner(cx, sp, t))); }
       ty::ty_task. { llty = T_taskptr(*cx); }
       ty::ty_rec(fields) {
-        let tys: TypeRef[] = ~[];
+        let tys: [TypeRef] = ~[];
         for f: ty::field  in fields {
             tys += ~[type_of_inner(cx, sp, f.mt.ty)];
         }
@@ -383,10 +383,10 @@ fn get_simple_extern_fn(externs: &hashmap[str, ValueRef], llmod: ModuleRef,
 fn trans_native_call(b: &builder, glues: @glue_fns, lltaskptr: ValueRef,
                      externs: &hashmap[str, ValueRef], tn: &type_names,
                      llmod: ModuleRef, name: &str, pass_task: bool,
-                     args: &ValueRef[]) -> ValueRef {
+                     args: &[ValueRef]) -> ValueRef {
     let n: int = std::ivec::len[ValueRef](args) as int;
     let llnative: ValueRef = get_simple_extern_fn(externs, llmod, name, n);
-    let call_args: ValueRef[] = ~[];
+    let call_args: [ValueRef] = ~[];
     for a: ValueRef  in args { call_args += ~[b.ZExtOrBitCast(a, T_int())]; }
     ret b.Call(llnative, call_args);
 }
@@ -534,7 +534,7 @@ fn static_size_of_tag(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> uint {
 }
 
 fn dynamic_size_of(cx: &@block_ctxt, t: ty::t) -> result {
-    fn align_elements(cx: &@block_ctxt, elts: &ty::t[]) -> result {
+    fn align_elements(cx: &@block_ctxt, elts: &[ty::t]) -> result {
         //
         // C padding rules:
         //
@@ -565,7 +565,7 @@ fn align_elements(cx: &@block_ctxt, elts: &ty::t[]) -> result {
         ret rslt(szptr.bcx, szptr.bcx.build.Load(szptr.val));
       }
       ty::ty_rec(flds) {
-        let tys: ty::t[] = ~[];
+        let tys: [ty::t] = ~[];
         for f: ty::field  in flds { tys += ~[f.mt.ty]; }
         ret align_elements(cx, tys);
       }
@@ -579,8 +579,8 @@ fn align_elements(cx: &@block_ctxt, elts: &ty::t[]) -> result {
         for variant: ty::variant_info  in variants {
             // Perform type substitution on the raw argument types.
 
-            let raw_tys: ty::t[] = variant.args;
-            let tys: ty::t[] = ~[];
+            let raw_tys: [ty::t] = variant.args;
+            let tys: [ty::t] = ~[];
             for raw_ty: ty::t  in raw_tys {
                 let t = ty::substitute_type_params(bcx_tcx(cx), tps, raw_ty);
                 tys += ~[t];
@@ -642,8 +642,8 @@ fn dynamic_align_of(cx: &@block_ctxt, t: &ty::t) -> result {
 
 // Simple wrapper around GEP that takes an array of ints and wraps them
 // in C_int()
-fn GEPi(cx: &@block_ctxt, base: ValueRef, ixs: &int[]) -> ValueRef {
-    let v: ValueRef[] = ~[];
+fn GEPi(cx: &@block_ctxt, base: ValueRef, ixs: &[int]) -> ValueRef {
+    let v: [ValueRef] = ~[];
     for i: int  in ixs { v += ~[C_int(i)]; }
     ret cx.build.GEP(base, v);
 }
@@ -666,7 +666,7 @@ fn bump_ptr(bcx: &@block_ctxt, t: &ty::t, base: ValueRef, sz: ValueRef)
 // ty::struct and knows what to do when it runs into a ty_param stuck in the
 // middle of the thing it's GEP'ing into. Much like size_of and align_of,
 // above.
-fn GEP_tup_like(cx: &@block_ctxt, t: &ty::t, base: ValueRef, ixs: &int[]) ->
+fn GEP_tup_like(cx: &@block_ctxt, t: &ty::t, base: ValueRef, ixs: &[int]) ->
    result {
     assert (ty::type_is_tup_like(bcx_tcx(cx), t));
     // It might be a static-known type. Handle this.
@@ -689,8 +689,8 @@ fn GEP_tup_like(cx: &@block_ctxt, t: &ty::t, base: ValueRef, ixs: &int[]) ->
     // elements of the type and splitting the Xth off. Return the prefix as
     // well as the innermost Xth type.
 
-    fn split_type(ccx: &@crate_ctxt, t: &ty::t, ixs: &int[], n: uint) ->
-       {prefix: ty::t[], target: ty::t} {
+    fn split_type(ccx: &@crate_ctxt, t: &ty::t, ixs: &[int], n: uint) ->
+       {prefix: [ty::t], target: ty::t} {
         let len: uint = std::ivec::len[int](ixs);
         // We don't support 0-index or 1-index GEPs: The former is nonsense
         // and the latter would only be meaningful if we supported non-0
@@ -707,7 +707,7 @@ fn split_type(ccx: &@crate_ctxt, t: &ty::t, ixs: &int[], n: uint) ->
         }
         assert (n < len);
         let ix: int = ixs.(n);
-        let prefix: ty::t[] = ~[];
+        let prefix: [ty::t] = ~[];
         let i: int = 0;
         while i < ix {
             prefix += ~[ty::get_element_type(ccx.tcx, t, i as uint)];
@@ -749,7 +749,7 @@ fn split_type(ccx: &@crate_ctxt, t: &ty::t, ixs: &int[], n: uint) ->
 // appropriate. @llblobptr is the data part of a tag value; its actual type is
 // meaningless, as it will be cast away.
 fn GEP_tag(cx: @block_ctxt, llblobptr: ValueRef, tag_id: &ast::def_id,
-           variant_id: &ast::def_id, ty_substs: &ty::t[], ix: int) -> result {
+           variant_id: &ast::def_id, ty_substs: &[ty::t], ix: int) -> result {
     let variant = ty::tag_variant_with_id(bcx_tcx(cx), tag_id, variant_id);
     // Synthesize a tuple type so that GEP_tup_like() can work its magic.
     // Separately, store the type of the element we're interested in.
@@ -758,7 +758,7 @@ fn GEP_tag(cx: @block_ctxt, llblobptr: ValueRef, tag_id: &ast::def_id,
     let elem_ty = ty::mk_nil(bcx_tcx(cx)); // typestate infelicity
 
     let i = 0;
-    let true_arg_tys: ty::t[] = ~[];
+    let true_arg_tys: [ty::t] = ~[];
     for aty: ty::t  in arg_tys {
         let arg_ty = ty::substitute_type_params(bcx_tcx(cx), ty_substs, aty);
         true_arg_tys += ~[arg_ty];
@@ -869,11 +869,11 @@ fn field_of_tydesc(cx: &@block_ctxt, t: &ty::t, escapes: bool, field: int) ->
 // indices of the ty params present in the type. This is used solely for
 // constructing derived tydescs.
 fn linearize_ty_params(cx: &@block_ctxt, t: &ty::t) ->
-   {params: uint[], descs: ValueRef[]} {
-    let param_vals: ValueRef[] = ~[];
-    let param_defs: uint[] = ~[];
+   {params: [uint], descs: [ValueRef]} {
+    let param_vals: [ValueRef] = ~[];
+    let param_defs: [uint] = ~[];
     type rr =
-        {cx: @block_ctxt, mutable vals: ValueRef[], mutable defs: uint[]};
+        {cx: @block_ctxt, mutable vals: [ValueRef], mutable defs: [uint]};
 
     fn linearizer(r: @rr, t: ty::t) {
         alt ty::struct(bcx_tcx(r.cx), t) {
@@ -1007,7 +1007,7 @@ fn get_tydesc(cx: &@block_ctxt, orig_t: &ty::t, escapes: bool,
     ret rslt(cx, info.tydesc);
 }
 
-fn get_static_tydesc(cx: &@block_ctxt, orig_t: &ty::t, ty_params: &uint[]) ->
+fn get_static_tydesc(cx: &@block_ctxt, orig_t: &ty::t, ty_params: &[uint]) ->
    @tydesc_info {
     let t = ty::strip_cname(bcx_tcx(cx), orig_t);
 
@@ -1051,7 +1051,7 @@ fn set_glue_inlining(cx: &@local_ctxt, f: ValueRef, t: &ty::t) {
 
 
 // Generates the declaration for (but doesn't emit) a type descriptor.
-fn declare_tydesc(cx: &@local_ctxt, sp: &span, t: &ty::t, ty_params: &uint[])
+fn declare_tydesc(cx: &@local_ctxt, sp: &span, t: &ty::t, ty_params: &[uint])
    -> @tydesc_info {
     log "+++ declare_tydesc " + ty_to_str(cx.ccx.tcx, t);
     let ccx = cx.ccx;
@@ -1109,7 +1109,7 @@ fn declare_generic_glue(cx: &@local_ctxt, t: &ty::t, llfnty: TypeRef,
 fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
                            llfn: ValueRef,
                            helper: &make_generic_glue_helper_fn,
-                           ty_params: &uint[]) -> ValueRef {
+                           ty_params: &[uint]) -> ValueRef {
     let fcx = new_fn_ctxt(cx, sp, llfn);
     llvm::LLVMSetLinkage(llfn,
                          lib::llvm::LLVMInternalLinkage as llvm::Linkage);
@@ -1126,7 +1126,7 @@ fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
     let ty_param_count = std::ivec::len[uint](ty_params);
     let lltyparams = llvm::LLVMGetParam(llfn, 3u);
     let copy_args_bcx = new_raw_block_ctxt(fcx, fcx.llcopyargs);
-    let lltydescs = ~[mutable ];
+    let lltydescs = ~[mutable];
     let p = 0u;
     while p < ty_param_count {
         let llparam = copy_args_bcx.build.GEP(lltyparams, ~[C_int(p as int)]);
@@ -1158,7 +1158,7 @@ fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
 }
 
 fn make_generic_glue(cx: &@local_ctxt, sp: &span, t: &ty::t, llfn: ValueRef,
-                     helper: &make_generic_glue_helper_fn, ty_params: &uint[],
+                     helper: &make_generic_glue_helper_fn, ty_params: &[uint],
                      name: &str) -> ValueRef {
     if !cx.ccx.sess.get_opts().stats {
         ret make_generic_glue_inner(cx, sp, t, llfn, helper, ty_params);
@@ -1439,7 +1439,7 @@ fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
 }
 
 fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: &ast::def_id,
-                  inner_t: ty::t, tps: &ty::t[]) -> result {
+                  inner_t: ty::t, tps: &[ty::t]) -> result {
     let ccx = bcx_ccx(cx);
     let inner_t_s = ty::substitute_type_params(ccx.tcx, tps, inner_t);
     let tup_ty = ty::mk_imm_tup(ccx.tcx, ~[ty::mk_int(ccx.tcx), inner_t_s]);
@@ -1619,7 +1619,7 @@ fn inner(last_cx: @block_ctxt, load_inner: bool, flag: ValueRef,
             if load_inner {
                 // If `load_inner` is true, then the pointer type will always
                 // be i8, because the data part of a vector always has type
-                // i8[]. So we need to cast it to the proper type.
+                // [i8]. So we need to cast it to the proper type.
 
                 if !ty::type_has_dynamic_size(bcx_tcx(last_cx), t) {
                     let llelemty =
@@ -1820,13 +1820,13 @@ fn adaptor_fn(f: val_and_ty_fn, cx: &@block_ctxt, av: ValueRef,
     ret iter_structural_ty_full(cx, v, v, t, bind adaptor_fn(f, _, _, _, _));
 }
 
-fn load_inbounds(cx: &@block_ctxt, p: ValueRef, idxs: &ValueRef[]) ->
+fn load_inbounds(cx: &@block_ctxt, p: ValueRef, idxs: &[ValueRef]) ->
    ValueRef {
     ret cx.build.Load(cx.build.InBoundsGEP(p, idxs));
 }
 
 fn store_inbounds(cx: &@block_ctxt, v: ValueRef, p: ValueRef,
-                  idxs: &ValueRef[]) {
+                  idxs: &[ValueRef]) {
     cx.build.Store(v, cx.build.InBoundsGEP(p, idxs));
 }
 
@@ -1920,7 +1920,7 @@ fn adapter(bcx: &@block_ctxt, av: ValueRef, bv: ValueRef,
     }
 
     fn iter_variant(cx: @block_ctxt, a_tup: ValueRef, b_tup: ValueRef,
-                    variant: &ty::variant_info, tps: &ty::t[],
+                    variant: &ty::variant_info, tps: &[ty::t],
                     tid: &ast::def_id, f: &val_pair_and_ty_fn) -> result {
         if std::ivec::len[ty::t](variant.args) == 0u {
             ret rslt(cx, C_nil());
@@ -2332,7 +2332,7 @@ fn call_cmp_glue(cx: &@block_ctxt, lhs: ValueRef, rhs: ValueRef, t: &ty::t,
     }
 
     let llcmpresultptr = alloca(r.bcx, T_i1());
-    let llargs: ValueRef[] =
+    let llargs: [ValueRef] =
         ~[llcmpresultptr, r.bcx.fcx.lltaskptr, lltydesc,
           lltydescs, llrawlhsptr, llrawrhsptr, llop];
     r.bcx.build.Call(llfn, llargs);
@@ -3540,11 +3540,11 @@ fn trans_binary(cx: &@block_ctxt, op: ast::binop, a: &@ast::expr,
     }
 }
 
-fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &result[]) ->
+fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &[result]) ->
    result {
-    let live: result[] = ~[];
-    let vals: ValueRef[] = ~[];
-    let bbs: BasicBlockRef[] = ~[];
+    let live: [result] = ~[];
+    let vals: [ValueRef] = ~[];
+    let bbs: [BasicBlockRef] = ~[];
     for r: result  in ins {
         if !is_terminated(r.bcx) {
             live += ~[r];
@@ -3571,7 +3571,7 @@ fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &result[]) ->
     ret rslt(join_cx, phi);
 }
 
-fn join_branches(parent_cx: &@block_ctxt, ins: &result[]) -> @block_ctxt {
+fn join_branches(parent_cx: &@block_ctxt, ins: &[result]) -> @block_ctxt {
     let out = new_sub_block_ctxt(parent_cx, "join");
     for r: result  in ins {
         if !is_terminated(r.bcx) { r.bcx.build.Br(out.llbb); }
@@ -3665,8 +3665,8 @@ fn inner(cx: &@block_ctxt, local: @ast::local, curr: ValueRef, t: ty::t,
 // construct a closure out of them. If copying is true, it is a
 // heap allocated closure that copies the upvars into environment.
 // Otherwise, it is stack allocated and copies pointers to the upvars.
-fn build_environment(bcx: @block_ctxt, lltydescs: ValueRef[],
-                     bound_tys: ty::t[], bound_vals: lval_result[],
+fn build_environment(bcx: @block_ctxt, lltydescs: [ValueRef],
+                     bound_tys: [ty::t], bound_vals: [lval_result],
                      copying: bool)
     -> {ptr: ValueRef, ptrty: ty::t, bcx: @block_ctxt} {
     // Synthesize a closure type.
@@ -3684,7 +3684,7 @@ fn build_environment(bcx: @block_ctxt, lltydescs: ValueRef[],
     // (We'll need room for that many tydescs in the closure.)
     let ty_param_count = std::ivec::len(lltydescs);
     let tydesc_ty: ty::t = ty::mk_type(bcx_tcx(bcx));
-    let captured_tys: ty::t[] =
+    let captured_tys: [ty::t] =
         std::ivec::init_elt(tydesc_ty, ty_param_count);
 
     // Get all the types we've got (some of which we synthesized
@@ -3693,7 +3693,7 @@ fn build_environment(bcx: @block_ctxt, lltydescs: ValueRef[],
 
     // closure_tys = [tydesc_ty, [bound_ty1, bound_ty2, ...], [tydesc_ty,
     // tydesc_ty, ...]]
-    let closure_tys: ty::t[] =
+    let closure_tys: [ty::t] =
         ~[tydesc_ty, bindings_ty, ty::mk_imm_tup(bcx_tcx(bcx), captured_tys)];
 
     // Finally, synthesize a type for that whole vector.
@@ -3761,10 +3761,10 @@ fn build_environment(bcx: @block_ctxt, lltydescs: ValueRef[],
 
 // Given a context and a list of upvars, build a closure. This just
 // collects the upvars and packages them up for build_environment.
-fn build_closure(cx: &@block_ctxt, upvars: &@ast::node_id[], copying: bool)
+fn build_closure(cx: &@block_ctxt, upvars: &@[ast::node_id], copying: bool)
     -> {ptr: ValueRef, ptrty: ty::t, bcx: @block_ctxt} {
-        let closure_vals: lval_result[] = ~[];
-        let closure_tys: ty::t[] = ~[];
+        let closure_vals: [lval_result] = ~[];
+        let closure_tys: [ty::t] = ~[];
         // If we need to, package up the iterator body to call
         if !copying && !option::is_none(cx.fcx.lliterbody) {
             closure_vals += ~[lval_mem(cx, option::get(cx.fcx.lliterbody))];
@@ -3816,7 +3816,7 @@ fn find_environment_tydescs(bcx: &@block_ctxt, envty: &ty::t,
 // and a list of upvars, generate code to load and populate the environment
 // with the upvars and type descriptors.
 fn load_environment(enclosing_cx: &@block_ctxt, fcx: &@fn_ctxt,
-                    envty: &ty::t, upvars: &@ast::node_id[],
+                    envty: &ty::t, upvars: &@[ast::node_id],
                     copying: bool) {
     let bcx = new_raw_block_ctxt(fcx, fcx.llcopyargs);
 
@@ -3972,8 +3972,8 @@ fn trans_do_while(cx: &@block_ctxt, body: &ast::blk, cond: &@ast::expr) ->
 
 type generic_info =
     {item_type: ty::t,
-     static_tis: (option::t[@tydesc_info])[],
-     tydescs: ValueRef[]};
+     static_tis: [option::t[@tydesc_info]],
+     tydescs: [ValueRef]};
 
 type lval_result =
     {res: result,
@@ -4020,8 +4020,8 @@ fn lval_generic_fn(cx: &@block_ctxt, tpt: &ty::ty_param_kinds_and_ty,
     let tys = ty::node_id_to_type_params(bcx_tcx(cx), id);
     if std::ivec::len[ty::t](tys) != 0u {
         let bcx = lv.res.bcx;
-        let tydescs: ValueRef[] = ~[];
-        let tis: (option::t[@tydesc_info])[] = ~[];
+        let tydescs: [ValueRef] = ~[];
+        let tis: [option::t[@tydesc_info]] = ~[];
         for t: ty::t  in tys {
             // TODO: Doesn't always escape.
 
@@ -4116,7 +4116,7 @@ fn trans_var(cx: &@block_ctxt, sp: &span, id: ast::node_id) ->
             ret lval_mem(cx, ccx.consts.get(did.node));
         } else {
             let tp = ty::node_id_to_monotype(ccx.tcx, id);
-            let k: ast::kind[] = ~[];
+            let k: [ast::kind] = ~[];
             ret lval_val(cx,
                          load_if_immediate(cx,
                                            trans_external_path(cx, did,
@@ -4405,8 +4405,8 @@ fn t_kind(tcx: &ty::ctxt, t: ty::t) -> kind {
 }
 
 fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
-                    outgoing_fty: &ty::t, args: &(option::t[@ast::expr])[],
-                    env_ty: &ty::t, bound_tys: &ty::t[],
+                    outgoing_fty: &ty::t, args: &[option::t[@ast::expr]],
+                    env_ty: &ty::t, bound_tys: &[ty::t],
                     ty_param_count: uint) -> {val: ValueRef, ty: TypeRef} {
 
     // Here we're not necessarily constructing a thunk in the sense of
@@ -4493,7 +4493,7 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
     }
 
     // Set up the three implicit arguments to the thunk.
-    let llargs: ValueRef[] = ~[llretptr, fcx.lltaskptr, lltargetclosure];
+    let llargs: [ValueRef] = ~[llretptr, fcx.lltaskptr, lltargetclosure];
 
     // Copy in the type parameters.
     let i: uint = 0u;
@@ -4512,7 +4512,7 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
     let a: uint = 3u; // retptr, task ptr, env come first
     let b: int = 1;
     let outgoing_arg_index: uint = 0u;
-    let llout_arg_tys: TypeRef[] =
+    let llout_arg_tys: [TypeRef] =
         type_of_explicit_args(cx.ccx, sp, outgoing_args);
     for arg: option::t[@ast::expr]  in args {
         let out_arg = outgoing_args.(outgoing_arg_index);
@@ -4589,15 +4589,15 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
 }
 
 fn trans_bind(cx: &@block_ctxt, f: &@ast::expr,
-              args: &(option::t[@ast::expr])[], id: ast::node_id) -> result {
+              args: &[option::t[@ast::expr]], id: ast::node_id) -> result {
     let f_res = trans_lval_gen(cx, f);
     ret trans_bind_1(cx, f, f_res, args, id);
 }
 
 fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
-                args: &(option::t[@ast::expr])[], id: ast::node_id) ->
+                args: &[option::t[@ast::expr]], id: ast::node_id) ->
    result {
-    let bound: (@ast::expr)[] = ~[];
+    let bound: [@ast::expr] = ~[];
     for argopt: option::t[@ast::expr]  in args {
         alt argopt { none. { } some(e) { bound += ~[e]; } }
     }
@@ -4605,7 +4605,7 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
     // Figure out which tydescs we need to pass, if any.
     let outgoing_fty: ty::t = ty::expr_ty(bcx_tcx(cx), f);
     let outgoing_fty_real; // the type with typarams still in it
-    let lltydescs: ValueRef[];
+    let lltydescs: [ValueRef];
     alt f_res.generic {
       none. { outgoing_fty_real = outgoing_fty; lltydescs = ~[]; }
       some(ginfo) {
@@ -4630,8 +4630,8 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
     let bound_f = {res: {bcx: bcx, val: src_loc} with f_res};
 
     // Arrange for the bound function to live in the first binding spot.
-    let bound_tys: ty::t[] = ~[outgoing_fty];
-    let bound_vals: lval_result[] = ~[bound_f];
+    let bound_tys: [ty::t] = ~[outgoing_fty];
+    let bound_vals: [lval_result] = ~[bound_f];
     // Translate the bound expressions.
     for e: @ast::expr  in bound {
         let lv = trans_lval(bcx, e);
@@ -4726,11 +4726,11 @@ fn trans_arg_expr(cx: &@block_ctxt, arg: &ty::arg, lldestty0: TypeRef,
 //  - trans_args
 fn trans_args(cx: &@block_ctxt, llenv: ValueRef,
               gen: &option::t[generic_info], lliterbody: &option::t[ValueRef],
-              es: &(@ast::expr)[], fn_ty: &ty::t) ->
-   {bcx: @block_ctxt, args: ValueRef[], retslot: ValueRef} {
-    let args: ty::arg[] = ty::ty_fn_args(bcx_tcx(cx), fn_ty);
-    let llargs: ValueRef[] = ~[];
-    let lltydescs: ValueRef[] = ~[];
+              es: &[@ast::expr], fn_ty: &ty::t) ->
+   {bcx: @block_ctxt, args: [ValueRef], retslot: ValueRef} {
+    let args: [ty::arg] = ty::ty_fn_args(bcx_tcx(cx), fn_ty);
+    let llargs: [ValueRef] = ~[];
+    let lltydescs: [ValueRef] = ~[];
     let bcx: @block_ctxt = cx;
     // Arg 0: Output pointer.
 
@@ -4799,7 +4799,7 @@ fn trans_args(cx: &@block_ctxt, llenv: ValueRef,
 }
 
 fn trans_call(cx: &@block_ctxt, f: &@ast::expr,
-              lliterbody: &option::t[ValueRef], args: &(@ast::expr)[],
+              lliterbody: &option::t[ValueRef], args: &[@ast::expr],
               id: ast::node_id) -> result {
     // NB: 'f' isn't necessarily a function; it might be an entire self-call
     // expression because of the hack that allows us to process self-calls
@@ -4882,7 +4882,7 @@ fn trans_call(cx: &@block_ctxt, f: &@ast::expr,
     ret rslt(bcx, retval);
 }
 
-fn trans_vec(cx: &@block_ctxt, args: &(@ast::expr)[], id: ast::node_id) ->
+fn trans_vec(cx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
    result {
     let t = node_id_type(bcx_ccx(cx), id);
     let unit_ty = t;
@@ -4942,7 +4942,7 @@ fn trans_vec(cx: &@block_ctxt, args: &(@ast::expr)[], id: ast::node_id) ->
 
 
 // TODO: Move me to ivec::
-fn trans_ivec(bcx: @block_ctxt, args: &(@ast::expr)[], id: ast::node_id) ->
+fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
    result {
     let typ = node_id_type(bcx_ccx(bcx), id);
     let unit_ty;
@@ -5035,7 +5035,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &(@ast::expr)[], id: ast::node_id) ->
     ret rslt(bcx, llvecptr);
 }
 
-fn trans_rec(cx: &@block_ctxt, fields: &ast::field[],
+fn trans_rec(cx: &@block_ctxt, fields: &[ast::field],
              base: &option::t[@ast::expr], id: ast::node_id) -> result {
     let bcx = cx;
     let t = node_id_type(bcx_ccx(bcx), id);
@@ -5053,7 +5053,7 @@ fn trans_rec(cx: &@block_ctxt, fields: &ast::field[],
         base_val = base_res.val;
       }
     }
-    let ty_fields: ty::field[] = ~[];
+    let ty_fields: [ty::field] = ~[];
     alt ty::struct(bcx_tcx(cx), t) { ty::ty_rec(flds) { ty_fields = flds; } }
     for tf: ty::field  in ty_fields {
         let e_ty = tf.mt.ty;
@@ -5489,7 +5489,7 @@ fn trans_put(cx: &@block_ctxt, e: &option::t[@ast::expr]) -> result {
     }
     let bcx = cx;
     let dummy_retslot = alloca(bcx, T_nil());
-    let llargs: ValueRef[] = ~[dummy_retslot, cx.fcx.lltaskptr, llenv];
+    let llargs: [ValueRef] = ~[dummy_retslot, cx.fcx.lltaskptr, llenv];
     alt e {
       none. { }
       some(x) {
@@ -5637,9 +5637,9 @@ fn trans_anon_obj(bcx: @block_ctxt, sp: &span, anon_obj: &ast::anon_obj,
     // Fields.
     // FIXME (part of issue #538): Where do we fill in the field *values* from
     // the outer object?
-    let additional_fields: ast::anon_obj_field[] = ~[];
-    let additional_field_vals: result[] = ~[];
-    let additional_field_tys: ty::t[] = ~[];
+    let additional_fields: [ast::anon_obj_field] = ~[];
+    let additional_field_vals: [result] = ~[];
+    let additional_field_tys: [ty::t] = ~[];
     alt anon_obj.fields {
       none. { }
       some(fields) {
@@ -5894,7 +5894,7 @@ fn trans_stmt(cx: &@block_ctxt, s: &ast::stmt) -> result {
 // next three functions instead.
 fn new_block_ctxt(cx: &@fn_ctxt, parent: &block_parent, kind: block_kind,
                   name: &str) -> @block_ctxt {
-    let cleanups: cleanup[] = ~[];
+    let cleanups: [cleanup] = ~[];
     let s = str::buf("");
     let held_name; //HACK for str::buf, which doesn't keep its value alive
     if cx.lcx.ccx.sess.get_opts().save_temps ||
@@ -5938,7 +5938,7 @@ fn new_sub_block_ctxt(bcx: &@block_ctxt, n: &str) -> @block_ctxt {
 }
 
 fn new_raw_block_ctxt(fcx: &@fn_ctxt, llbb: BasicBlockRef) -> @block_ctxt {
-    let cleanups: cleanup[] = ~[];
+    let cleanups: [cleanup] = ~[];
     ret @{llbb: llbb,
           build: new_builder(llbb),
           parent: parent_none,
@@ -5993,7 +5993,7 @@ fn trans_block_cleanups(cx: &@block_ctxt, cleanup_cx: &@block_ctxt) ->
 }
 
 fn llstaticallocas_block_ctxt(fcx: &@fn_ctxt) -> @block_ctxt {
-    let cleanups: cleanup[] = ~[];
+    let cleanups: [cleanup] = ~[];
     ret @{llbb: fcx.llstaticallocas,
           build: new_builder(fcx.llstaticallocas),
           parent: parent_none,
@@ -6004,7 +6004,7 @@ fn llstaticallocas_block_ctxt(fcx: &@fn_ctxt) -> @block_ctxt {
 }
 
 fn llderivedtydescs_block_ctxt(fcx: &@fn_ctxt) -> @block_ctxt {
-    let cleanups: cleanup[] = ~[];
+    let cleanups: [cleanup] = ~[];
     ret @{llbb: fcx.llderivedtydescs,
           build: new_builder(fcx.llderivedtydescs),
           parent: parent_none,
@@ -6015,7 +6015,7 @@ fn llderivedtydescs_block_ctxt(fcx: &@fn_ctxt) -> @block_ctxt {
 }
 
 fn lldynamicallocas_block_ctxt(fcx: &@fn_ctxt) -> @block_ctxt {
-    let cleanups: cleanup[] = ~[];
+    let cleanups: [cleanup] = ~[];
     ret @{llbb: fcx.lldynamicallocas,
           build: new_builder(fcx.lldynamicallocas),
           parent: parent_none,
@@ -6122,7 +6122,7 @@ fn accept_out_method(expr: &@ast::expr) -> bool {
 }
 
 fn new_local_ctxt(ccx: &@crate_ctxt) -> @local_ctxt {
-    let pth: str[] = ~[];
+    let pth: [str] = ~[];
     ret @{path: pth,
           module_path: ~[ccx.link_meta.name],
           obj_typarams: ~[],
@@ -6207,7 +6207,7 @@ fn new_fn_ctxt(cx: @local_ctxt, sp: &span, llfndecl: ValueRef) -> @fn_ctxt {
 // field of the fn_ctxt with
 fn create_llargs_for_fn_args(cx: &@fn_ctxt, proto: ast::proto,
                              ty_self: option::t[ty::t], ret_ty: ty::t,
-                             args: &ast::arg[], ty_params: &ast::ty_param[]) {
+                             args: &[ast::arg], ty_params: &[ast::ty_param]) {
     // Skip the implicit arguments 0, 1, and 2.  TODO: Pull out 3u and define
     // it as a constant, since we're using it in several places in trans this
     // way.
@@ -6247,8 +6247,8 @@ fn create_llargs_for_fn_args(cx: &@fn_ctxt, proto: ast::proto,
     }
 }
 
-fn copy_args_to_allocas(fcx: @fn_ctxt, args: &ast::arg[],
-                        arg_tys: &ty::arg[]) {
+fn copy_args_to_allocas(fcx: @fn_ctxt, args: &[ast::arg],
+                        arg_tys: &[ty::arg]) {
     let bcx = new_raw_block_ctxt(fcx, fcx.llcopyargs);
     let arg_n: uint = 0u;
     for aarg: ast::arg  in args {
@@ -6270,8 +6270,8 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, args: &ast::arg[],
     }
 }
 
-fn add_cleanups_for_args(bcx: &@block_ctxt, args: &ast::arg[],
-                         arg_tys: &ty::arg[]) {
+fn add_cleanups_for_args(bcx: &@block_ctxt, args: &[ast::arg],
+                         arg_tys: &[ty::arg]) {
     let arg_n: uint = 0u;
     for aarg: ast::arg  in args {
         if aarg.mode == ast::val {
@@ -6294,7 +6294,7 @@ fn is_terminated(cx: &@block_ctxt) -> bool {
     ret llvm::LLVMIsATerminatorInst(inst) as int != 0;
 }
 
-fn arg_tys_of_fn(ccx: &@crate_ctxt, id: ast::node_id) -> ty::arg[] {
+fn arg_tys_of_fn(ccx: &@crate_ctxt, id: ast::node_id) -> [ty::arg] {
     alt ty::struct(ccx.tcx, ty::node_id_to_type(ccx.tcx, id)) {
       ty::ty_fn(_, arg_tys, _, _, _) { ret arg_tys; }
     }
@@ -6302,7 +6302,7 @@ fn arg_tys_of_fn(ccx: &@crate_ctxt, id: ast::node_id) -> ty::arg[] {
 
 fn populate_fn_ctxt_from_llself(fcx: @fn_ctxt, llself: val_self_pair) {
     let bcx = llstaticallocas_block_ctxt(fcx);
-    let field_tys: ty::t[] = ~[];
+    let field_tys: [ty::t] = ~[];
     for f: ast::obj_field  in bcx.fcx.lcx.obj_fields {
         field_tys += ~[node_id_type(bcx_ccx(bcx), f.id)];
     }
@@ -6368,7 +6368,7 @@ fn finish_fn(fcx: &@fn_ctxt, lltop: BasicBlockRef) {
 fn trans_closure(bcx_maybe: &option::t[@block_ctxt],
                  llfnty: &option::t[TypeRef], cx: @local_ctxt, sp: &span,
                  f: &ast::_fn, llfndecl: ValueRef, ty_self: option::t[ty::t],
-                 ty_params: &ast::ty_param[], id: ast::node_id)
+                 ty_params: &[ast::ty_param], id: ast::node_id)
     -> option::t[{fn_pair: ValueRef, bcx: @block_ctxt}] {
     set_uwtable(llfndecl);
 
@@ -6443,7 +6443,7 @@ fn trans_closure(bcx_maybe: &option::t[@block_ctxt],
 
 fn trans_fn_inner(cx: @local_ctxt, sp: &span, f: &ast::_fn,
                   llfndecl: ValueRef, ty_self: option::t[ty::t],
-                  ty_params: &ast::ty_param[], id: ast::node_id) {
+                  ty_params: &[ast::ty_param], id: ast::node_id) {
     trans_closure(none, none, cx, sp, f, llfndecl, ty_self, ty_params, id);
 }
 
@@ -6451,7 +6451,7 @@ fn trans_fn_inner(cx: @local_ctxt, sp: &span, f: &ast::_fn,
 // trans_fn: creates an LLVM function corresponding to a source language
 // function.
 fn trans_fn(cx: @local_ctxt, sp: &span, f: &ast::_fn, llfndecl: ValueRef,
-            ty_self: option::t[ty::t], ty_params: &ast::ty_param[],
+            ty_self: option::t[ty::t], ty_params: &[ast::ty_param],
             id: ast::node_id) {
     if !cx.ccx.sess.get_opts().stats {
         trans_fn_inner(cx, sp, f, llfndecl, ty_self, ty_params, id);
@@ -6517,8 +6517,8 @@ fn populate_self_stack(bcx: @block_ctxt,
 // the corresponding method on inner does, calls that method on outer, and
 // returns the value returned from that call.
 fn process_bkwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
-                       ty_params: &ast::ty_param[], outer_obj_ty: ty::t,
-                       additional_field_tys: &ty::t[]) -> ValueRef {
+                       ty_params: &[ast::ty_param], outer_obj_ty: ty::t,
+                       additional_field_tys: &[ty::t]) -> ValueRef {
 
     // Create a local context that's aware of the name of the method we're
     // creating.
@@ -6609,7 +6609,7 @@ fn process_bkwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
     // Set up the three implicit arguments to the outer method we'll need
     // to call.
     let self_arg = llself_obj_ptr;
-    let llouter_mthd_args: ValueRef[] = ~[llretptr, fcx.lltaskptr, self_arg];
+    let llouter_mthd_args: [ValueRef] = ~[llretptr, fcx.lltaskptr, self_arg];
 
     // Copy the explicit arguments that are being passed into the forwarding
     // function (they're in fcx.llargs) to llouter_mthd_args.
@@ -6648,9 +6648,9 @@ fn process_bkwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
 // from that call.  (The inner object won't exist until run-time, but we know
 // its type statically.)
 fn process_fwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
-                       ty_params: &ast::ty_param[], inner_obj_ty: ty::t,
+                       ty_params: &[ast::ty_param], inner_obj_ty: ty::t,
                        backwarding_vtbl: ValueRef,
-                       additional_field_tys: &ty::t[]) -> ValueRef {
+                       additional_field_tys: &[ty::t]) -> ValueRef {
 
     // Create a local context that's aware of the name of the method we're
     // creating.
@@ -6798,7 +6798,7 @@ fn process_fwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
 
     // Set up the three implicit arguments to the original method we'll need
     // to call.
-    let llorig_mthd_args: ValueRef[] = ~[llretptr, fcx.lltaskptr, self_stack];
+    let llorig_mthd_args: [ValueRef] = ~[llretptr, fcx.lltaskptr, self_stack];
 
     // Copy the explicit arguments that are being passed into the forwarding
     // function (they're in fcx.llargs) to llorig_mthd_args.
@@ -6825,7 +6825,7 @@ fn process_fwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
 // process_normal_mthd: Create the contents of a normal vtable slot.  A helper
 // function for create_vtbl.
 fn process_normal_mthd(cx: @local_ctxt, m: @ast::method, self_ty: ty::t,
-                       ty_params: &ast::ty_param[]) -> ValueRef {
+                       ty_params: &[ast::ty_param]) -> ValueRef {
 
     let llfnty = T_nil();
     alt ty::struct(cx.ccx.tcx, node_id_type(cx.ccx, m.node.id)) {
@@ -6911,11 +6911,11 @@ fn filtering_fn(cx: @local_ctxt, m: &vtbl_mthd,
 // Create a vtable for an object being translated.  Returns a pointer into
 // read-only memory.
 fn create_vtbl(cx: @local_ctxt, sp: &span, outer_obj_ty: ty::t,
-               ob: &ast::_obj, ty_params: &ast::ty_param[],
+               ob: &ast::_obj, ty_params: &[ast::ty_param],
                inner_obj_ty: option::t[ty::t],
-               additional_field_tys: &ty::t[]) -> ValueRef {
+               additional_field_tys: &[ty::t]) -> ValueRef {
 
-    let llmethods: ValueRef[] = ~[];
+    let llmethods: [ValueRef] = ~[];
 
     alt inner_obj_ty {
       none. {
@@ -6945,7 +6945,7 @@ fn create_vtbl(cx: @local_ctxt, sp: &span, outer_obj_ty: ty::t,
         // original methods onto the list of methods we need forwarding
         // methods for.
 
-        let meths: vtbl_mthd[] = ~[];
+        let meths: [vtbl_mthd] = ~[];
 
         // Gather up methods on the original object in 'meths'.
         alt ty::struct(cx.ccx.tcx, inner_obj_ty) {
@@ -7012,8 +7012,8 @@ fn create_backwarding_vtbl(cx: @local_ctxt, sp: &span, inner_obj_ty: ty::t,
     // object, and it needs to forward them to the corresponding slots on the
     // outer object.  All we know about either one are their types.
 
-    let llmethods: ValueRef[] = ~[];
-    let meths: ty::method[]= ~[];
+    let llmethods: [ValueRef] = ~[];
+    let meths: [ty::method]= ~[];
 
     // Gather up methods on the inner object.
     alt ty::struct(cx.ccx.tcx, inner_obj_ty) {
@@ -7055,7 +7055,7 @@ fn create_backwarding_vtbl(cx: @local_ctxt, sp: &span, inner_obj_ty: ty::t,
 // trans_obj: creates an LLVM function that is the object constructor for the
 // object being translated.
 fn trans_obj(cx: @local_ctxt, sp: &span, ob: &ast::_obj,
-             ctor_id: ast::node_id, ty_params: &ast::ty_param[]) {
+             ctor_id: ast::node_id, ty_params: &[ast::ty_param]) {
     // To make a function, we have to create a function context and, inside
     // that, a number of block contexts for which code is generated.
 
@@ -7072,7 +7072,7 @@ fn trans_obj(cx: @local_ctxt, sp: &span, ob: &ast::_obj,
     // The fields of our object will become the arguments to the function
     // we're creating.
 
-    let fn_args: ast::arg[] = ~[];
+    let fn_args: [ast::arg] = ~[];
     for f: ast::obj_field  in ob.fields {
         fn_args +=
             ~[{mode: ast::alias(false), ty: f.ty, ident: f.ident, id: f.id}];
@@ -7083,7 +7083,7 @@ fn trans_obj(cx: @local_ctxt, sp: &span, ob: &ast::_obj,
     create_llargs_for_fn_args(fcx, ast::proto_fn, none[ty::t],
                               ty::ret_ty_of_fn(ccx.tcx, ctor_id), fn_args,
                               ty_params);
-    let arg_tys: ty::arg[] = arg_tys_of_fn(ccx, ctor_id);
+    let arg_tys: [ty::arg] = arg_tys_of_fn(ccx, ctor_id);
     copy_args_to_allocas(fcx, fn_args, arg_tys);
 
     //  Create the first block context in the function and keep a handle on it
@@ -7138,14 +7138,14 @@ fn trans_obj(cx: @local_ctxt, sp: &span, ob: &ast::_obj,
     } else {
         // Otherwise, we have to synthesize a big structural type for the
         // object body.
-        let obj_fields: ty::t[] = ~[];
+        let obj_fields: [ty::t] = ~[];
         for a: ty::arg  in arg_tys { obj_fields += ~[a.ty]; }
 
         // Tuple type for fields: [field, ...]
         let fields_ty: ty::t = ty::mk_imm_tup(ccx.tcx, obj_fields);
 
         let tydesc_ty = ty::mk_type(ccx.tcx);
-        let tps: ty::t[] = ~[];
+        let tps: [ty::t] = ~[];
         for tp: ast::ty_param  in ty_params { tps += ~[tydesc_ty]; }
 
         // Tuple type for typarams: [typaram, ...]
@@ -7237,7 +7237,7 @@ fn trans_obj(cx: @local_ctxt, sp: &span, ob: &ast::_obj,
 }
 
 fn trans_res_ctor(cx: @local_ctxt, sp: &span, dtor: &ast::_fn,
-                  ctor_id: ast::node_id, ty_params: &ast::ty_param[]) {
+                  ctor_id: ast::node_id, ty_params: &[ast::ty_param]) {
     // Create a function for the constructor
     let llctor_decl;
     alt cx.ccx.item_ids.find(ctor_id) {
@@ -7277,14 +7277,14 @@ fn trans_res_ctor(cx: @local_ctxt, sp: &span, dtor: &ast::_fn,
 
 fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
                      variant: &ast::variant, index: int, is_degen: bool,
-                     ty_params: &ast::ty_param[]) {
+                     ty_params: &[ast::ty_param]) {
     if std::ivec::len[ast::variant_arg](variant.node.args) == 0u {
         ret; // nullary constructors are just constants
 
     }
     // Translate variant arguments to function arguments.
 
-    let fn_args: ast::arg[] = ~[];
+    let fn_args: [ast::arg] = ~[];
     let i = 0u;
     for varg: ast::variant_arg  in variant.node.args {
         fn_args +=
@@ -7306,7 +7306,7 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
     create_llargs_for_fn_args(fcx, ast::proto_fn, none[ty::t],
                               ty::ret_ty_of_fn(cx.ccx.tcx, variant.node.id),
                               fn_args, ty_params);
-    let ty_param_substs: ty::t[] = ~[];
+    let ty_param_substs: [ty::t] = ~[];
     i = 0u;
     for tp: ast::ty_param  in ty_params {
         ty_param_substs += ~[ty::mk_param(cx.ccx.tcx, i, tp.kind)];
@@ -7459,14 +7459,14 @@ fn get_pair_fn_ty(llpairty: TypeRef) -> TypeRef {
     ret struct_elt(llpairty, 0u);
 }
 
-fn decl_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &str[], flav: str,
-                    ty_params: &ast::ty_param[], node_id: ast::node_id) {
+fn decl_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str], flav: str,
+                    ty_params: &[ast::ty_param], node_id: ast::node_id) {
     decl_fn_and_pair_full(ccx, sp, path, flav, ty_params, node_id,
                           node_id_type(ccx, node_id));
 }
 
-fn decl_fn_and_pair_full(ccx: &@crate_ctxt, sp: &span, path: &str[],
-                         flav: str, ty_params: &ast::ty_param[],
+fn decl_fn_and_pair_full(ccx: &@crate_ctxt, sp: &span, path: &[str],
+                         flav: str, ty_params: &[ast::ty_param],
                          node_id: ast::node_id, node_type: ty::t) {
     let llfty = type_of_fn_from_ty(ccx, sp, node_type,
                                    std::ivec::len(ty_params));
@@ -7573,7 +7573,7 @@ fn native_fn_wrapper_type(cx: &@crate_ctxt, sp: &span, ty_param_count: uint,
     }
 }
 
-fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &str[],
+fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str],
                            name: str, id: ast::node_id) {
     let num_ty_param = native_fn_ty_param_count(ccx, id);
     // Declare the wrapper.
@@ -7640,7 +7640,7 @@ fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &str[],
         lltaskptr = vp2i(bcx, fcx.lltaskptr);
     } else { lltaskptr = fcx.lltaskptr; }
 
-    let call_args: ValueRef[] = ~[];
+    let call_args: [ValueRef] = ~[];
     if pass_task { call_args += ~[lltaskptr]; }
     if uses_retptr { call_args += ~[bcx.fcx.llretptr]; }
 
@@ -7674,10 +7674,10 @@ fn convert_arg_to_i32(cx: &@block_ctxt, v: ValueRef, t: ty::t,
     }
 
     fn trans_simple_native_abi(bcx: &@block_ctxt, name: str,
-                               call_args: &mutable ValueRef[], fn_type: ty::t,
+                               call_args: &mutable [ValueRef], fn_type: ty::t,
                                first_arg_n: uint, uses_retptr: bool, cc: uint)
        -> {val: ValueRef, rptr: ValueRef} {
-        let call_arg_tys: TypeRef[] = ~[];
+        let call_arg_tys: [TypeRef] = ~[];
         for arg: ValueRef  in call_args { call_arg_tys += ~[val_ty(arg)]; }
 
         let llnativefnty;
@@ -7704,7 +7704,7 @@ fn trans_simple_native_abi(bcx: &@block_ctxt, name: str,
     let args = ty::ty_fn_args(ccx.tcx, fn_type);
     // Build up the list of arguments.
 
-    let drop_args: {val: ValueRef, ty: ty::t}[] = ~[];
+    let drop_args: [{val: ValueRef, ty: ty::t}] = ~[];
     let i = arg_n;
     for arg: ty::arg  in args {
         let llarg = llvm::LLVMGetParam(fcx.llfn, i);
@@ -7765,10 +7765,10 @@ fn trans_simple_native_abi(bcx: &@block_ctxt, name: str,
     finish_fn(fcx, lltop);
 }
 
-fn item_path(item: &@ast::item) -> str[] { ret ~[item.ident]; }
+fn item_path(item: &@ast::item) -> [str] { ret ~[item.ident]; }
 
-fn collect_native_item(ccx: @crate_ctxt, i: &@ast::native_item, pt: &str[],
-                       v: &vt[str[]]) {
+fn collect_native_item(ccx: @crate_ctxt, i: &@ast::native_item, pt: &[str],
+                       v: &vt[[str]]) {
     alt i.node {
       ast::native_item_fn(_, _, _) {
         if !ccx.obj_methods.contains_key(i.id) {
@@ -7779,8 +7779,8 @@ fn collect_native_item(ccx: @crate_ctxt, i: &@ast::native_item, pt: &str[],
     }
 }
 
-fn collect_item_1(ccx: @crate_ctxt, i: &@ast::item, pt: &str[],
-                  v: &vt[str[]]) {
+fn collect_item_1(ccx: @crate_ctxt, i: &@ast::item, pt: &[str],
+                  v: &vt[[str]]) {
     visit::visit_item(i, pt + item_path(i), v);
     alt i.node {
       ast::item_const(_, _) {
@@ -7798,8 +7798,8 @@ fn collect_item_1(ccx: @crate_ctxt, i: &@ast::item, pt: &str[],
     }
 }
 
-fn collect_item_2(ccx: &@crate_ctxt, i: &@ast::item, pt: &str[],
-                  v: &vt[str[]]) {
+fn collect_item_2(ccx: &@crate_ctxt, i: &@ast::item, pt: &[str],
+                  v: &vt[[str]]) {
     let new_pt = pt + item_path(i);
     visit::visit_item(i, new_pt, v);
     alt i.node {
@@ -7838,8 +7838,8 @@ fn collect_items(ccx: &@crate_ctxt, crate: @ast::crate) {
     visit::visit_crate(*crate, ~[], visit::mk_vt(visitor2));
 }
 
-fn collect_tag_ctor(ccx: @crate_ctxt, i: &@ast::item, pt: &str[],
-                    v: &vt[str[]]) {
+fn collect_tag_ctor(ccx: @crate_ctxt, i: &@ast::item, pt: &[str],
+                    v: &vt[[str]]) {
     let new_pt = pt + item_path(i);
     visit::visit_item(i, new_pt, v);
     alt i.node {
@@ -7864,8 +7864,8 @@ fn collect_tag_ctors(ccx: &@crate_ctxt, crate: @ast::crate) {
 
 
 // The constant translation pass.
-fn trans_constant(ccx: @crate_ctxt, it: &@ast::item, pt: &str[],
-                  v: &vt[str[]]) {
+fn trans_constant(ccx: @crate_ctxt, it: &@ast::item, pt: &[str],
+                  v: &vt[[str]]) {
     let new_pt = pt + item_path(it);
     visit::visit_item(it, new_pt, v);
     alt it.node {
@@ -7913,15 +7913,15 @@ fn i2p(v: ValueRef, t: TypeRef) -> ValueRef {
 }
 
 fn declare_intrinsics(llmod: ModuleRef) -> hashmap[str, ValueRef] {
-    let T_memmove32_args: TypeRef[] =
+    let T_memmove32_args: [TypeRef] =
         ~[T_ptr(T_i8()), T_ptr(T_i8()), T_i32(), T_i32(), T_i1()];
-    let T_memmove64_args: TypeRef[] =
+    let T_memmove64_args: [TypeRef] =
         ~[T_ptr(T_i8()), T_ptr(T_i8()), T_i64(), T_i32(), T_i1()];
-    let T_memset32_args: TypeRef[] =
+    let T_memset32_args: [TypeRef] =
         ~[T_ptr(T_i8()), T_i8(), T_i32(), T_i32(), T_i1()];
-    let T_memset64_args: TypeRef[] =
+    let T_memset64_args: [TypeRef] =
         ~[T_ptr(T_i8()), T_i8(), T_i64(), T_i32(), T_i1()];
-    let T_trap_args: TypeRef[] = ~[];
+    let T_trap_args: [TypeRef] = ~[];
     let memmove32 =
         decl_cdecl_fn(llmod, "llvm.memmove.p0i8.p0i8.i32",
                       T_fn(T_memmove32_args, T_void()));
@@ -7958,7 +7958,7 @@ fn trace_ptr(cx: &@block_ctxt, v: ValueRef) {
 }
 
 fn trap(bcx: &@block_ctxt) {
-    let v: ValueRef[] = ~[];
+    let v: [ValueRef] = ~[];
     alt bcx_ccx(bcx).intrinsics.find("llvm.trap") {
       some(x) { bcx.build.Call(x, v); }
       _ { bcx_ccx(bcx).sess.bug("unbound llvm.trap in trap"); }
@@ -8019,7 +8019,7 @@ fn create_module_map(ccx: &@crate_ctxt) -> ValueRef {
         llvm::LLVMAddGlobal(ccx.llmod, maptype, str::buf("_rust_mod_map"));
     llvm::LLVMSetLinkage(map,
                          lib::llvm::LLVMInternalLinkage as llvm::Linkage);
-    let elts: ValueRef[] = ~[];
+    let elts: [ValueRef] = ~[];
     for each item: @{key: str, val: ValueRef}  in ccx.module_data.items() {
         let elt = C_struct(~[p2i(C_cstr(ccx, item.key)), p2i(item.val)]);
         elts += ~[elt];
@@ -8033,7 +8033,7 @@ fn create_module_map(ccx: &@crate_ctxt) -> ValueRef {
 
 // FIXME use hashed metadata instead of crate names once we have that
 fn create_crate_map(ccx: &@crate_ctxt) -> ValueRef {
-    let subcrates: ValueRef[] = ~[];
+    let subcrates: [ValueRef] = ~[];
     let i = 1;
     let cstore = ccx.sess.get_cstore();
     while cstore::have_crate_data(cstore, i) {
index cdfff0ffe9a908d9603e10189f8a6bc2a485aa22..f15922a20fe2af456e4aa0e54cf70e2dee03c693 100644 (file)
@@ -53,10 +53,10 @@ fn variant_opt(ccx: &@crate_ctxt, pat_id: ast::node_id) -> opt {
     fail;
 }
 
-type bind_map = {ident: ast::ident, val: ValueRef}[];
+type bind_map = [{ident: ast::ident, val: ValueRef}];
 type match_branch =
-    @{pats: (@ast::pat)[], body: BasicBlockRef, mutable bound: bind_map};
-type match = match_branch[];
+    @{pats: [@ast::pat], body: BasicBlockRef, mutable bound: bind_map};
+type match = [match_branch];
 
 fn matches_always(p: &@ast::pat) -> bool {
     ret alt p.node {
@@ -75,7 +75,7 @@ fn bind_for_pat(p: &@ast::pat, br: &match_branch, val: ValueRef) {
     }
 }
 
-type enter_pat = fn(&@ast::pat) -> option::t[(@ast::pat)[]] ;
+type enter_pat = fn(&@ast::pat) -> option::t[[@ast::pat]] ;
 
 fn enter_match(m: &match, col: uint, val: ValueRef, e: &enter_pat) -> match {
     let result = ~[];
@@ -96,7 +96,7 @@ fn enter_match(m: &match, col: uint, val: ValueRef, e: &enter_pat) -> match {
 }
 
 fn enter_default(m: &match, col: uint, val: ValueRef) -> match {
-    fn e(p: &@ast::pat) -> option::t[(@ast::pat)[]] {
+    fn e(p: &@ast::pat) -> option::t[[@ast::pat]] {
         ret if matches_always(p) { some(~[]) } else { none };
     }
     ret enter_match(m, col, val, e);
@@ -106,7 +106,7 @@ fn enter_opt(ccx: &@crate_ctxt, m: &match, opt: &opt, col: uint,
              tag_size: uint, val: ValueRef) -> match {
     let dummy = @{id: 0, node: ast::pat_wild, span: {lo: 0u, hi: 0u}};
     fn e(ccx: &@crate_ctxt, dummy: &@ast::pat, opt: &opt, size: uint,
-         p: &@ast::pat) -> option::t[(@ast::pat)[]] {
+         p: &@ast::pat) -> option::t[[@ast::pat]] {
         alt p.node {
           ast::pat_tag(ctor, subpats) {
             ret if opt_eq(variant_opt(ccx, p.id), opt) {
@@ -122,11 +122,11 @@ fn e(ccx: &@crate_ctxt, dummy: &@ast::pat, opt: &opt, size: uint,
     ret enter_match(m, col, val, bind e(ccx, dummy, opt, tag_size, _));
 }
 
-fn enter_rec(m: &match, col: uint, fields: &ast::ident[], val: ValueRef) ->
+fn enter_rec(m: &match, col: uint, fields: &[ast::ident], val: ValueRef) ->
    match {
     let dummy = @{id: 0, node: ast::pat_wild, span: {lo: 0u, hi: 0u}};
-    fn e(dummy: &@ast::pat, fields: &ast::ident[], p: &@ast::pat) ->
-       option::t[(@ast::pat)[]] {
+    fn e(dummy: &@ast::pat, fields: &[ast::ident], p: &@ast::pat) ->
+       option::t[[@ast::pat]] {
         alt p.node {
           ast::pat_rec(fpats, _) {
             let pats = ~[];
@@ -147,7 +147,7 @@ fn e(dummy: &@ast::pat, fields: &ast::ident[], p: &@ast::pat) ->
 
 fn enter_box(m: &match, col: uint, val: ValueRef) -> match {
     let dummy = @{id: 0, node: ast::pat_wild, span: {lo: 0u, hi: 0u}};
-    fn e(dummy: &@ast::pat, p: &@ast::pat) -> option::t[(@ast::pat)[]] {
+    fn e(dummy: &@ast::pat, p: &@ast::pat) -> option::t[[@ast::pat]] {
         alt p.node {
           ast::pat_box(sub) { ret some(~[sub]); }
           _ { ret some(~[dummy]); }
@@ -156,8 +156,8 @@ fn e(dummy: &@ast::pat, p: &@ast::pat) -> option::t[(@ast::pat)[]] {
     ret enter_match(m, col, val, bind e(dummy, _));
 }
 
-fn get_options(ccx: &@crate_ctxt, m: &match, col: uint) -> opt[] {
-    fn add_to_set(set: &mutable opt[], val: &opt) {
+fn get_options(ccx: &@crate_ctxt, m: &match, col: uint) -> [opt] {
+    fn add_to_set(set: &mutable [opt], val: &opt) {
         for l: opt  in set { if opt_eq(l, val) { ret; } }
         set += ~[val];
     }
@@ -177,7 +177,7 @@ fn add_to_set(set: &mutable opt[], val: &opt) {
 
 fn extract_variant_args(bcx: @block_ctxt, pat_id: ast::node_id,
                         vdefs: &{tg: def_id, var: def_id}, val: ValueRef)
-    -> {vals: ValueRef[], bcx: @block_ctxt} {
+    -> {vals: [ValueRef], bcx: @block_ctxt} {
     let ccx = bcx.fcx.lcx.ccx;
     let ty_param_substs = ty::node_id_to_type_params(ccx.tcx, pat_id);
     let blobptr = val;
@@ -203,7 +203,7 @@ fn extract_variant_args(bcx: @block_ctxt, pat_id: ast::node_id,
     ret {vals: args, bcx: bcx};
 }
 
-fn collect_record_fields(m: &match, col: uint) -> ast::ident[] {
+fn collect_record_fields(m: &match, col: uint) -> [ast::ident] {
     let fields = ~[];
     for br: match_branch  in m {
         alt br.pats.(col).node {
@@ -260,8 +260,8 @@ fn pick_col(m: &match) -> uint {
     ret best_col;
 }
 
-fn compile_submatch(bcx: @block_ctxt, m: &match, vals: ValueRef[],
-                    f: &mk_fail, exits: &mutable exit_node[]) {
+fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
+                    f: &mk_fail, exits: &mutable [exit_node]) {
     if ivec::len(m) == 0u { bcx.build.Br(f()); ret; }
     if ivec::len(m.(0).pats) == 0u {
         exits += ~[{bound: m.(0).bound, from: bcx.llbb, to: m.(0).body}];
@@ -391,7 +391,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: ValueRef[],
 }
 
 // Returns false for unreachable blocks
-fn make_phi_bindings(bcx: &@block_ctxt, map: &exit_node[],
+fn make_phi_bindings(bcx: &@block_ctxt, map: &[exit_node],
                      ids: &ast::pat_id_map) -> bool {
     fn assoc(key: str, list: &bind_map) -> option::t[ValueRef] {
         for elt: {ident: ast::ident, val: ValueRef}  in list {
@@ -421,7 +421,7 @@ fn assoc(key: str, list: &bind_map) -> option::t[ValueRef] {
     ret success;
 }
 
-fn trans_alt(cx: &@block_ctxt, expr: &@ast::expr, arms: &ast::arm[],
+fn trans_alt(cx: &@block_ctxt, expr: &@ast::expr, arms: &[ast::arm],
              id: ast::node_id, output: &trans::out_method) -> result {
     let bodies = ~[];
     let match: match = ~[];
index 2fc24f8cb528f39daa1406d875abcb805cfcff0f..6891b28f01003ac57f4ef0c9fc0f1c7c8942138e 100644 (file)
@@ -63,7 +63,7 @@ fn trans_chan(cx: &@block_ctxt, e: &@ast::expr, id: ast::node_id) -> result {
 }
 
 fn trans_spawn(cx: &@block_ctxt, dom: &ast::spawn_dom, name: &option::t[str],
-               func: &@ast::expr, args: &(@ast::expr)[], id: ast::node_id) ->
+               func: &@ast::expr, args: &[@ast::expr], id: ast::node_id) ->
    result {
     let bcx = cx;
     // Make the task name
@@ -107,8 +107,8 @@ fn trans_spawn(cx: &@block_ctxt, dom: &ast::spawn_dom, name: &option::t[str],
     // Translate the arguments, remembering their types and where the values
     // ended up.
 
-    let arg_tys: ty::t[] = ~[];
-    let arg_vals: ValueRef[] = ~[];
+    let arg_tys: [ty::t] = ~[];
+    let arg_vals: [ValueRef] = ~[];
     for e: @ast::expr  in args {
         let e_ty = ty::expr_ty(cx.fcx.lcx.ccx.tcx, e);
         let arg = trans_expr(bcx, e);
@@ -168,7 +168,7 @@ fn mk_spawn_wrapper(cx: &@block_ctxt, func: &@ast::expr, args_ty: &ty::t) ->
     // 3u to skip the three implicit args
 
     let arg: ValueRef = llvm::LLVMGetParam(fcx.llfn, 3u);
-    let child_args: ValueRef[] =
+    let child_args: [ValueRef] =
         ~[llvm::LLVMGetParam(fcx.llfn, 0u), llvm::LLVMGetParam(fcx.llfn, 1u),
           llvm::LLVMGetParam(fcx.llfn, 2u)];
     // unpack the arguments
index 5166e1acab9a4ef1de3ff5c8ea35c45f6b669bd4..e006802704280e0b95acf5aea648057f339d3bc1 100644 (file)
@@ -79,7 +79,7 @@
      mutable drop_glue: option::t[ValueRef],
      mutable free_glue: option::t[ValueRef],
      mutable cmp_glue: option::t[ValueRef],
-     ty_params: uint[]};
+     ty_params: [uint]};
 
 /*
  * A note on nomenclature of linking: "upcall", "extern" and "native".
      mutable n_glues_created: uint,
      mutable n_null_glues: uint,
      mutable n_real_glues: uint,
-     fn_times: @mutable {ident: str, time: int}[]};
+     fn_times: @mutable [{ident: str, time: int}]};
 
 // Crate context.  Every crate we compile has one of these.
 type crate_ctxt = {
 };
 
 type local_ctxt =
-    {path: str[],
-     module_path: str[],
-     obj_typarams: ast::ty_param[],
-     obj_fields: ast::obj_field[],
+    {path: [str],
+     module_path: [str],
+     obj_typarams: [ast::ty_param],
+     obj_fields: [ast::obj_field],
      ccx: @crate_ctxt};
 
 // Types used for llself.
     // this functions type parameters, fetched via llvm::LLVMGetParam.
     // For example, for a function foo[A, B, C](), lltydescs contains
     // the ValueRefs for the tydescs for A, B, and C.
-    mutable lltydescs: ValueRef[],
+    mutable lltydescs: [ValueRef],
 
     // Derived tydescs are tydescs created at runtime, for types that
     // involve type parameters inside type constructors.  For example,
@@ -386,7 +386,7 @@ fn get_res_dtor(ccx : &@crate_ctxt, sp : &span, did : &ast::def_id,
     // A list of functions that run at the end of translating this
     // block, cleaning up any variables that were introduced in the
     // block and need to go out of scope at the end of it.
-    mutable cleanups: cleanup[],
+    mutable cleanups: [cleanup],
 
     // The source span where this block comes from, for error
     // reporting.
@@ -508,7 +508,7 @@ fn T_size_t() -> TypeRef {
     ret T_i32();
 }
 
-fn T_fn(inputs: &TypeRef[], output: TypeRef) -> TypeRef {
+fn T_fn(inputs: &[TypeRef], output: TypeRef) -> TypeRef {
     ret llvm::LLVMFunctionType(output, std::ivec::to_ptr(inputs),
                                std::ivec::len[TypeRef](inputs), False);
 }
@@ -519,7 +519,7 @@ fn T_fn_pair(cx: &crate_ctxt, tfn: TypeRef) -> TypeRef {
 
 fn T_ptr(t: TypeRef) -> TypeRef { ret llvm::LLVMPointerType(t, 0u); }
 
-fn T_struct(elts: &TypeRef[]) -> TypeRef {
+fn T_struct(elts: &[TypeRef]) -> TypeRef {
     ret llvm::LLVMStructType(std::ivec::to_ptr(elts), std::ivec::len(elts),
                              False);
 }
@@ -529,7 +529,7 @@ fn T_named_struct(name: &str) -> TypeRef {
     ret llvm::LLVMStructCreateNamed(c, str::buf(name));
 }
 
-fn set_struct_body(t: TypeRef, elts: &TypeRef[]) {
+fn set_struct_body(t: TypeRef, elts: &[TypeRef]) {
     llvm::LLVMStructSetBody(t, std::ivec::to_ptr(elts), std::ivec::len(elts),
                             False);
 }
@@ -569,7 +569,7 @@ fn T_task() -> TypeRef {
 fn T_tydesc_field(cx: &crate_ctxt, field: int) -> TypeRef {
     // Bit of a kludge: pick the fn typeref out of the tydesc..
 
-    let tydesc_elts: TypeRef[] =
+    let tydesc_elts: [TypeRef] =
         std::ivec::init_elt[TypeRef](T_nil(), abi::n_tydesc_fields as uint);
     llvm::LLVMGetStructElementTypes(cx.tydesc_type,
                                     std::ivec::to_ptr[TypeRef](tydesc_elts));
@@ -843,33 +843,33 @@ fn C_postr(s: &str) -> ValueRef {
 
 fn C_zero_byte_arr(size: uint) -> ValueRef {
     let i = 0u;
-    let elts: ValueRef[] = ~[];
+    let elts: [ValueRef] = ~[];
     while i < size { elts += ~[C_u8(0u)]; i += 1u; }
     ret llvm::LLVMConstArray(T_i8(), std::ivec::to_ptr(elts),
                              std::ivec::len(elts));
 }
 
-fn C_struct(elts: &ValueRef[]) -> ValueRef {
+fn C_struct(elts: &[ValueRef]) -> ValueRef {
     ret llvm::LLVMConstStruct(std::ivec::to_ptr(elts), std::ivec::len(elts),
                               False);
 }
 
-fn C_named_struct(T: TypeRef, elts: &ValueRef[]) -> ValueRef {
+fn C_named_struct(T: TypeRef, elts: &[ValueRef]) -> ValueRef {
     ret llvm::LLVMConstNamedStruct(T, std::ivec::to_ptr(elts),
                                    std::ivec::len(elts));
 }
 
-fn C_array(ty: TypeRef, elts: &ValueRef[]) -> ValueRef {
+fn C_array(ty: TypeRef, elts: &[ValueRef]) -> ValueRef {
     ret llvm::LLVMConstArray(ty, std::ivec::to_ptr(elts),
                              std::ivec::len(elts));
 }
 
-fn C_bytes(bytes : &u8[]) -> ValueRef {
+fn C_bytes(bytes : &[u8]) -> ValueRef {
     ret llvm::LLVMConstString(unsafe::reinterpret_cast(ivec::to_ptr(bytes)),
                               ivec::len(bytes), False);
 }
 
-fn C_shape(ccx : &@crate_ctxt, bytes : &u8[]) -> ValueRef {
+fn C_shape(ccx : &@crate_ctxt, bytes : &[u8]) -> ValueRef {
     let llshape = C_bytes(bytes);
     let llglobal = llvm::LLVMAddGlobal(ccx.llmod, val_ty(llshape),
                                        str::buf(ccx.names.next("shape")));
index 705a2dc534c678003a79c7aea3209240e5d657ec..4c50f5780c0fe661511e2b3bb4803ce74b7726af 100644 (file)
 import aux::add_node;
 import middle::tstate::ann::empty_ann;
 
-fn collect_ids_expr(e: &@expr, rs: @mutable node_id[]) { *rs += ~[e.id]; }
+fn collect_ids_expr(e: &@expr, rs: @mutable [node_id]) { *rs += ~[e.id]; }
 
-fn collect_ids_block(b: &blk, rs: @mutable node_id[]) { *rs += ~[b.node.id]; }
+fn collect_ids_block(b: &blk, rs: @mutable [node_id]) { *rs += ~[b.node.id]; }
 
-fn collect_ids_stmt(s: &@stmt, rs: @mutable node_id[]) {
+fn collect_ids_stmt(s: &@stmt, rs: @mutable [node_id]) {
     alt s.node {
       stmt_decl(_, id) {
         log "node_id " + int::str(id);
@@ -43,12 +43,12 @@ fn collect_ids_stmt(s: &@stmt, rs: @mutable node_id[]) {
     }
 }
 
-fn collect_ids_local(l: &@local, rs: @mutable node_id[]) {
+fn collect_ids_local(l: &@local, rs: @mutable [node_id]) {
     *rs += pat_binding_ids(l.node.pat);
 }
 
-fn node_ids_in_fn(f: &_fn, tps: &ty_param[], sp: &span, i: &fn_ident,
-                  id: node_id, rs: @mutable node_id[]) {
+fn node_ids_in_fn(f: &_fn, tps: &[ty_param], sp: &span, i: &fn_ident,
+                  id: node_id, rs: @mutable [node_id]) {
     let collect_ids =
         visit::mk_simple_visitor(@{visit_expr: bind collect_ids_expr(_, rs),
                                    visit_block: bind collect_ids_block(_, rs),
@@ -58,7 +58,7 @@ fn node_ids_in_fn(f: &_fn, tps: &ty_param[], sp: &span, i: &fn_ident,
     visit::visit_fn(f, tps, sp, i, id, (), collect_ids);
 }
 
-fn init_vecs(ccx: &crate_ctxt, node_ids: &node_id[], len: uint) {
+fn init_vecs(ccx: &crate_ctxt, node_ids: &[node_id], len: uint) {
     for i: node_id  in node_ids {
         log int::str(i) + " |-> " + uint::str(len);
         add_node(ccx, i, empty_ann(len));
@@ -66,14 +66,14 @@ fn init_vecs(ccx: &crate_ctxt, node_ids: &node_id[], len: uint) {
 }
 
 fn visit_fn(ccx: &crate_ctxt, num_constraints: uint, f: &_fn,
-            tps: &ty_param[], sp: &span, i: &fn_ident, id: node_id) {
-    let node_ids: @mutable node_id[] = @mutable ~[];
+            tps: &[ty_param], sp: &span, i: &fn_ident, id: node_id) {
+    let node_ids: @mutable [node_id] = @mutable ~[];
     node_ids_in_fn(f, tps, sp, i, id, node_ids);
     let node_id_vec = *node_ids;
     init_vecs(ccx, node_id_vec, num_constraints);
 }
 
-fn annotate_in_fn(ccx: &crate_ctxt, f: &_fn, tps: &ty_param[], sp: &span,
+fn annotate_in_fn(ccx: &crate_ctxt, f: &_fn, tps: &[ty_param], sp: &span,
                   i: &fn_ident, id: node_id) {
     let f_info = get_fn_info(ccx, id);
     visit_fn(ccx, num_constraints(f_info), f, tps, sp, i, id);
index 92a6cf9ae742b8d1c7cbf43fe34fc5e24351f4ff..10b5f9605302345e15543c7fc973a11077482193 100644 (file)
@@ -58,7 +58,7 @@ fn def_id_to_str(d: def_id) -> str {
     ret int::str(d.crate) + "," + int::str(d.node);
 }
 
-fn comma_str(args: &(@constr_arg_use)[]) -> str {
+fn comma_str(args: &[@constr_arg_use]) -> str {
     let rslt = "";
     let comma = false;
     for a: @constr_arg_use  in args {
@@ -117,7 +117,7 @@ fn first_difference_string(fcx: &fn_ctxt, expected: &tritv::t,
 
 fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) { log_err tritv_to_str(fcx, v); }
 
-fn tos(v: &uint[]) -> str {
+fn tos(v: &[uint]) -> str {
     let rslt = "";
     for i: uint  in v {
         if i == 0u {
@@ -127,9 +127,9 @@ fn tos(v: &uint[]) -> str {
     ret rslt;
 }
 
-fn log_cond(v: &uint[]) { log tos(v); }
+fn log_cond(v: &[uint]) { log tos(v); }
 
-fn log_cond_err(v: &uint[]) { log_err tos(v); }
+fn log_cond_err(v: &[uint]) { log_err tos(v); }
 
 fn log_pp(pp: &pre_and_post) {
     let p1 = tritv::to_vec(pp.precondition);
@@ -169,7 +169,7 @@ fn log_states_err(pp: &pre_and_post_state) {
 
 fn print_ident(i: &ident) { log " " + i + " "; }
 
-fn print_idents(idents: &mutable ident[]) {
+fn print_idents(idents: &mutable [ident]) {
     if ivec::len[ident](idents) == 0u { ret; }
     log "an ident: " + ivec::pop[ident](idents);
     print_idents(idents);
@@ -206,7 +206,7 @@ fn print_idents(idents: &mutable ident[]) {
 
 Both types store an ident and span, for error-logging purposes.
 */
-type pred_args_ = {args: (@constr_arg_use)[], bit_num: uint};
+type pred_args_ = {args: [@constr_arg_use], bit_num: uint};
 
 type pred_args = spanned[pred_args_];
 
@@ -219,7 +219,7 @@ fn print_idents(idents: &mutable ident[]) {
 
     // FIXME: really only want it to be mutable during collect_locals.
     // freeze it after that.
-    cpred(path, @mutable pred_args[]);
+    cpred(path, @mutable [pred_args]);
 }
 
 // An ninit variant has a node_id because it refers to a local var.
@@ -229,7 +229,7 @@ fn print_idents(idents: &mutable ident[]) {
 // and give ninit a constraint saying it's local.
 tag tsconstr {
     ninit(node_id, ident);
-    npred(path, def_id, (@constr_arg_use)[]);
+    npred(path, def_id, [@constr_arg_use]);
 }
 
 type sp_constr = spanned[tsconstr];
@@ -278,7 +278,7 @@ fn print_idents(idents: &mutable ident[]) {
      computation, of all local variables that may be
      used */
 // Doesn't seem to work without the @ -- bug
-     used_vars: @mutable node_id[]};
+     used_vars: @mutable [node_id]};
 
 fn tsconstr_to_def_id(t: &tsconstr) -> def_id {
     alt t { ninit(id, _) { local_def(id) } npred(_, id, _) { id } }
@@ -291,7 +291,7 @@ fn tsconstr_to_node_id(t: &tsconstr) -> node_id {
 }
 
 /* mapping from node ID to typestate annotation */
-type node_ann_table = @mutable ts_ann[mutable ];
+type node_ann_table = @mutable [mutable ts_ann];
 
 
 /* mapping from function name to fn_info map */
@@ -507,7 +507,7 @@ fn pure_exp(ccx: &crate_ctxt, id: node_id, p: &prestate) -> bool {
 fn num_constraints(m: fn_info) -> uint { ret m.num_constraints; }
 
 fn new_crate_ctxt(cx: ty::ctxt) -> crate_ctxt {
-    let na: ts_ann[mutable ] = ~[mutable ];
+    let na: [mutable ts_ann] = ~[mutable];
     ret {tcx: cx, node_anns: @mutable na, fm: @new_int_hash[fn_info]()};
 }
 
@@ -521,7 +521,7 @@ fn controlflow_expr(ccx: &crate_ctxt, e: @expr) -> controlflow {
     }
 }
 
-fn constraints_expr(cx: &ty::ctxt, e: @expr) -> (@ty::constr)[] {
+fn constraints_expr(cx: &ty::ctxt, e: @expr) -> [@ty::constr] {
     alt ty::struct(cx, ty::node_id_to_type(cx, e.id)) {
       ty::ty_fn(_, _, _, _, cs) { ret cs; }
       _ { ret ~[]; }
@@ -554,13 +554,13 @@ fn node_id_to_def_upvar(cx: &fn_ctxt, id: node_id) -> option::t[def] {
     ret freevars::def_lookup(cx.ccx.tcx, cx.id, id);
 }
 
-fn norm_a_constraint(id: def_id, c: &constraint) -> norm_constraint[] {
+fn norm_a_constraint(id: def_id, c: &constraint) -> [norm_constraint] {
     alt c {
       cinit(n, sp, i) {
         ret ~[{bit_num: n, c: respan(sp, ninit(id.node, i))}];
       }
       cpred(p, descs) {
-        let rslt: norm_constraint[] = ~[];
+        let rslt: [norm_constraint] = ~[];
         for pd: pred_args  in *descs {
             rslt +=
                 ~[{bit_num: pd.node.bit_num,
@@ -574,8 +574,8 @@ fn norm_a_constraint(id: def_id, c: &constraint) -> norm_constraint[] {
 
 // Tried to write this as an iterator, but I got a
 // non-exhaustive match in trans.
-fn constraints(fcx: &fn_ctxt) -> norm_constraint[] {
-    let rslt: norm_constraint[] = ~[];
+fn constraints(fcx: &fn_ctxt) -> [norm_constraint] {
+    let rslt: [norm_constraint] = ~[];
     for each p: @{key: def_id, val: constraint}  in
              fcx.enclosing.constrs.items() {
         rslt += norm_a_constraint(p.key, p.val);
@@ -586,8 +586,8 @@ fn constraints(fcx: &fn_ctxt) -> norm_constraint[] {
 // FIXME
 // Would rather take an immutable vec as an argument,
 // should freeze it at some earlier point.
-fn match_args(fcx: &fn_ctxt, occs: &@mutable pred_args[],
-              occ: &(@constr_arg_use)[]) -> uint {
+fn match_args(fcx: &fn_ctxt, occs: &@mutable [pred_args],
+              occ: &[@constr_arg_use]) -> uint {
     log "match_args: looking at " +
             constr_args_to_str(fn (i: &inst) -> str { ret i.ident; }, occ);
     for pd: pred_args  in *occs {
@@ -638,10 +638,10 @@ fn expr_to_constr_arg(tcx: ty::ctxt, e: &@expr) -> @constr_arg_use {
     }
 }
 
-fn exprs_to_constr_args(tcx: ty::ctxt, args: &(@expr)[]) ->
-   (@constr_arg_use)[] {
+fn exprs_to_constr_args(tcx: ty::ctxt, args: &[@expr]) ->
+   [@constr_arg_use] {
     let f = bind expr_to_constr_arg(tcx, _);
-    let rslt: (@constr_arg_use)[] = ~[];
+    let rslt: [@constr_arg_use] = ~[];
     for e: @expr  in args { rslt += ~[f(e)]; }
     rslt
 }
@@ -679,16 +679,16 @@ fn pred_args_to_str(p: &pred_args) -> str {
         + ">"
 }
 
-fn substitute_constr_args(cx: &ty::ctxt, actuals: &(@expr)[], c: &@ty::constr)
+fn substitute_constr_args(cx: &ty::ctxt, actuals: &[@expr], c: &@ty::constr)
    -> tsconstr {
-    let rslt: (@constr_arg_use)[] = ~[];
+    let rslt: [@constr_arg_use] = ~[];
     for a: @constr_arg  in c.node.args {
         rslt += ~[substitute_arg(cx, actuals, a)];
     }
     ret npred(c.node.path, c.node.id, rslt);
 }
 
-fn substitute_arg(cx: &ty::ctxt, actuals: &(@expr)[], a: @constr_arg) ->
+fn substitute_arg(cx: &ty::ctxt, actuals: &[@expr], a: @constr_arg) ->
    @constr_arg_use {
     let num_actuals = ivec::len(actuals);
     alt a.node {
@@ -704,7 +704,7 @@ fn substitute_arg(cx: &ty::ctxt, actuals: &(@expr)[], a: @constr_arg) ->
     }
 }
 
-fn pred_args_matches(pattern: &(constr_arg_general_[inst])[],
+fn pred_args_matches(pattern: &[constr_arg_general_[inst]],
                      desc: &pred_args) -> bool {
     let i = 0u;
     for c: @constr_arg_use  in desc.node.args {
@@ -729,8 +729,8 @@ fn pred_args_matches(pattern: &(constr_arg_general_[inst])[],
     ret true;
 }
 
-fn find_instance_(pattern: &(constr_arg_general_[inst])[],
-                  descs: &pred_args[]) -> option::t[uint] {
+fn find_instance_(pattern: &[constr_arg_general_[inst]],
+                  descs: &[pred_args]) -> option::t[uint] {
     for d: pred_args  in descs {
         if pred_args_matches(pattern, d) { ret some(d.node.bit_num); }
     }
@@ -738,10 +738,10 @@ fn find_instance_(pattern: &(constr_arg_general_[inst])[],
 }
 
 type inst = {ident: ident, node: node_id};
-type subst = {from: inst, to: inst}[];
+type subst = [{from: inst, to: inst}];
 
 fn find_instances(fcx: &fn_ctxt, subst: &subst, c: &constraint) ->
-   {from: uint, to: uint}[] {
+   [{from: uint, to: uint}] {
 
     let rslt = ~[];
     if ivec::len(subst) == 0u { ret rslt; }
@@ -775,7 +775,7 @@ fn find_in_subst_bool(s: &subst, id: node_id) -> bool {
     is_some(find_in_subst(id, s))
 }
 
-fn insts_to_str(stuff: &(constr_arg_general_[inst])[]) -> str {
+fn insts_to_str(stuff: &[constr_arg_general_[inst]]) -> str {
     let rslt = "<";
     for i: constr_arg_general_[inst]  in stuff {
         rslt +=
@@ -790,8 +790,8 @@ fn insts_to_str(stuff: &(constr_arg_general_[inst])[]) -> str {
     rslt
 }
 
-fn replace(subst: subst, d: pred_args) -> (constr_arg_general_[inst])[] {
-    let rslt: (constr_arg_general_[inst])[] = ~[];
+fn replace(subst: subst, d: pred_args) -> [constr_arg_general_[inst]] {
+    let rslt: [constr_arg_general_[inst]] = ~[];
     for c: @constr_arg_use  in d.node.args {
         alt c.node {
           carg_ident(p) {
@@ -991,7 +991,7 @@ fn forget_in_poststate_still_init(fcx: &fn_ctxt, p: &poststate,
     ret changed;
 }
 
-fn any_eq(v: &node_id[], d: node_id) -> bool {
+fn any_eq(v: &[node_id], d: node_id) -> bool {
     for i: node_id  in v { if i == d { ret true; } }
     false
 }
@@ -1012,13 +1012,13 @@ fn non_init_constraint_mentions(fcx: &fn_ctxt, c: &norm_constraint,
         };
 }
 
-fn args_mention[T](args: &(@constr_arg_use)[], q: fn(&T[], node_id) -> bool ,
-                   s: &T[]) -> bool {
+fn args_mention[T](args: &[@constr_arg_use], q: fn(&[T], node_id) -> bool ,
+                   s: &[T]) -> bool {
     /*
       FIXME
       The following version causes an assertion in trans to fail
       (something about type_is_tup_like)
-    fn mentions[T](&(T)[] s, &fn(&(T)[], def_id) -> bool q,
+    fn mentions[T](&[T] s, &fn(&[T], def_id) -> bool q,
                             &@constr_arg_use a) -> bool {
         alt (a.node) {
             case (carg_ident(?p1)) {
@@ -1041,7 +1041,7 @@ fn mentions[T](&(T)[] s, &fn(&(T)[], def_id) -> bool q,
 fn use_var(fcx: &fn_ctxt, v: &node_id) { *fcx.enclosing.used_vars += ~[v]; }
 
 // FIXME: This should be a function in std::ivec::.
-fn vec_contains(v: &@mutable node_id[], i: &node_id) -> bool {
+fn vec_contains(v: &@mutable [node_id], i: &node_id) -> bool {
     for d: node_id  in *v { if d == i { ret true; } }
     ret false;
 }
@@ -1051,33 +1051,33 @@ fn op_to_oper_ty(io: init_op) -> oper_type {
 }
 
 // default function visitor
-fn do_nothing[T](f: &_fn, tp: &ty_param[], sp: &span, i: &fn_ident,
+fn do_nothing[T](f: &_fn, tp: &[ty_param], sp: &span, i: &fn_ident,
                  iid: node_id, cx: &T, v: &visit::vt[T]) {
 }
 
 
-fn args_to_constr_args(sp: &span, args: &arg[]) -> (@constr_arg_use)[] {
-    let actuals: (@constr_arg_use)[] = ~[];
+fn args_to_constr_args(sp: &span, args: &[arg]) -> [@constr_arg_use] {
+    let actuals: [@constr_arg_use] = ~[];
     for a: arg  in args {
         actuals += ~[@respan(sp, carg_ident({ident: a.ident, node: a.id}))];
     }
     ret actuals;
 }
 
-fn ast_constr_to_ts_constr(tcx: &ty::ctxt, args: &arg[], c: &@constr) ->
+fn ast_constr_to_ts_constr(tcx: &ty::ctxt, args: &[arg], c: &@constr) ->
    tsconstr {
     let tconstr = ty::ast_constr_to_constr(tcx, c);
     ret npred(tconstr.node.path, tconstr.node.id,
               args_to_constr_args(tconstr.span, args));
 }
 
-fn ast_constr_to_sp_constr(tcx: &ty::ctxt, args: &arg[], c: &@constr) ->
+fn ast_constr_to_sp_constr(tcx: &ty::ctxt, args: &[arg], c: &@constr) ->
    sp_constr {
     let tconstr = ast_constr_to_ts_constr(tcx, args, c);
     ret respan(c.span, tconstr);
 }
 
-type binding = {lhs: inst[], rhs: option::t[initializer]};
+type binding = {lhs: [inst], rhs: option::t[initializer]};
 
 fn local_to_bindings(loc : &@local) -> binding {
     let lhs = ~[];
@@ -1089,11 +1089,11 @@ fn local_to_bindings(loc : &@local) -> binding {
      rhs: loc.node.init}
 }
 
-fn locals_to_bindings(locals : &(@local)[]) -> binding[] {
+fn locals_to_bindings(locals : &[@local]) -> [binding] {
     ivec::map(local_to_bindings, locals)
 }
 
-fn callee_modes(fcx: &fn_ctxt, callee: node_id) -> ty::mode[] {
+fn callee_modes(fcx: &fn_ctxt, callee: node_id) -> [ty::mode] {
     let ty = ty::type_autoderef(fcx.ccx.tcx,
                                 ty::node_id_to_type(fcx.ccx.tcx, callee));
     alt ty::struct(fcx.ccx.tcx, ty) {
@@ -1113,7 +1113,7 @@ fn callee_modes(fcx: &fn_ctxt, callee: node_id) -> ty::mode[] {
    }
 }
 
-fn callee_arg_init_ops(fcx: &fn_ctxt, callee: node_id) -> init_op[] {
+fn callee_arg_init_ops(fcx: &fn_ctxt, callee: node_id) -> [init_op] {
     fn mode_to_op(m: &ty::mode) -> init_op {
         alt m {
           ty::mo_move. { init_move }
@@ -1123,8 +1123,8 @@ fn mode_to_op(m: &ty::mode) -> init_op {
     ivec::map(mode_to_op, callee_modes(fcx, callee))
 }
 
-fn anon_bindings(ops: &init_op[], es : &(@expr)[]) -> binding[] {
-    let bindings: binding[] = ~[];
+fn anon_bindings(ops: &[init_op], es : &[@expr]) -> [binding] {
+    let bindings: [binding] = ~[];
     let i = 0;
     for op: init_op in ops {
         bindings += ~[{lhs: ~[],
index a055187e28676425dcb5a0dd89fbfc8df2934468..3f4a80c01c39e88d8ffee020453cf34808666ef6 100644 (file)
@@ -76,7 +76,7 @@ fn seq_tritv(p: &postcond, q: &postcond) {
     }
 }
 
-fn seq_postconds(fcx: &fn_ctxt, ps: &postcond[]) -> postcond {
+fn seq_postconds(fcx: &fn_ctxt, ps: &[postcond]) -> postcond {
     let sz = ivec::len(ps);
     if sz >= 1u {
         let prev = tritv_clone(ps.(0));
@@ -89,11 +89,11 @@ fn seq_postconds(fcx: &fn_ctxt, ps: &postcond[]) -> postcond {
 // return the precondition for evaluating each expr in order.
 // So, if e0's post is {x} and e1's pre is {x, y, z}, the entire
 // precondition shouldn't include x.
-fn seq_preconds(fcx: &fn_ctxt, pps: &pre_and_post[]) -> precond {
+fn seq_preconds(fcx: &fn_ctxt, pps: &[pre_and_post]) -> precond {
     let sz: uint = ivec::len(pps);
     let num_vars: uint = num_constraints(fcx.enclosing);
 
-    fn seq_preconds_go(fcx: &fn_ctxt, pps: &pre_and_post[],
+    fn seq_preconds_go(fcx: &fn_ctxt, pps: &[pre_and_post],
                        first: &pre_and_post) -> precond {
         let sz: uint = ivec::len(pps);
         if sz >= 1u {
index 73b845ac3bfb100ea5efc9a3dd4aefbfcf503661..94c2d5c625f9c7724cada1f6d77343112b38d1c4 100644 (file)
@@ -125,7 +125,7 @@ fn check_states_stmt(s: &@stmt, fcx: &fn_ctxt, v: &visit::vt[fn_ctxt]) {
 }
 
 fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
-                                   tps: &ast::ty_param[], id: node_id,
+                                   tps: &[ast::ty_param], id: node_id,
                                    sp: &span, i: &fn_ident) {
     /* Postorder traversal instead of pre is important
        because we want the smallest possible erroneous statement
@@ -170,7 +170,7 @@ fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
     check_unused_vars(fcx);
 }
 
-fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &ast::ty_param[], id: node_id,
+fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &[ast::ty_param], id: node_id,
                    sp: &span, i: &fn_ident) {
     /* Compute the pre- and post-states for this function */
 
@@ -183,7 +183,7 @@ fn check_fn_states(fcx: &fn_ctxt, f: &_fn, tps: &ast::ty_param[], id: node_id,
     check_states_against_conditions(fcx, f, tps, id, sp, i);
 }
 
-fn fn_states(f: &_fn, tps: &ast::ty_param[], sp: &span, i: &fn_ident,
+fn fn_states(f: &_fn, tps: &[ast::ty_param], sp: &span, i: &fn_ident,
              id: node_id, ccx: &crate_ctxt, v: &visit::vt[crate_ctxt]) {
     visit::visit_fn(f, tps, sp, i, id, ccx, v);
     /* Look up the var-to-bit-num map for this function */
index c420bc0151cfd892d995fc5ef4c340de9950d6b5..f60745d596a223d18480e6f241863cd1af8c9d76 100644 (file)
@@ -11,7 +11,7 @@
 import syntax::codemap::span;
 import syntax::ast::respan;
 
-type ctxt = {cs: @mutable sp_constr[], tcx: ty::ctxt};
+type ctxt = {cs: @mutable [sp_constr], tcx: ty::ctxt};
 
 fn collect_local(loc: &@local, cx: &ctxt, v: &visit::vt[ctxt]) {
     for each p: @pat in pat_bindings(loc.node.pat) {
@@ -43,7 +43,7 @@ fn collect_pred(e: &@expr, cx: &ctxt, v: &visit::vt[ctxt]) {
     visit::visit_expr(e, cx, v);
 }
 
-fn find_locals(tcx: &ty::ctxt, f: &_fn, tps: &ty_param[], sp: &span,
+fn find_locals(tcx: &ty::ctxt, f: &_fn, tps: &[ty_param], sp: &span,
                i: &fn_ident, id: node_id) -> ctxt {
     let cx: ctxt = {cs: @mutable ~[], tcx: tcx};
     let visitor = visit::default_visitor[ctxt]();
@@ -75,7 +75,7 @@ fn add_constraint(tcx: &ty::ctxt, c: sp_constr, next: uint, tbl: constr_map)
             }
           }
           none. {
-            let rslt: @mutable pred_args[] =
+            let rslt: @mutable [pred_args] =
                 @mutable ~[respan(c.span, {args: args, bit_num: next})];
             tbl.insert(d_id, cpred(p, rslt));
           }
@@ -88,7 +88,7 @@ fn add_constraint(tcx: &ty::ctxt, c: sp_constr, next: uint, tbl: constr_map)
 
 /* builds a table mapping each local var defined in f
    to a bit number in the precondition/postcondition vectors */
-fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &ty_param[], f_sp: &span,
+fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &[ty_param], f_sp: &span,
               f_name: &fn_ident, id: node_id) {
     let name = fn_ident_to_string(id, f_name);
     let res_map = @new_def_hash[constraint]();
@@ -122,7 +122,7 @@ fn mk_fn_info(ccx: &crate_ctxt, f: &_fn, tp: &ty_param[], f_sp: &span,
     add_constraint(cx.tcx, respan(f_sp, ninit(diverges_id, diverges_name)),
                    next, res_map);
 
-    let v: @mutable node_id[] = @mutable ~[];
+    let v: @mutable [node_id] = @mutable ~[];
     let rslt =
         {constrs: res_map,
          num_constraints:
index bade71525e3f6502c8619f5cdf49ff28f5c064ca..b4b78933e897904c95f2c55e8fb0491a6b96da57 100644 (file)
@@ -73,7 +73,7 @@ fn find_pre_post_item(ccx: &crate_ctxt, i: &item) {
     alt i.node {
       item_const(_, e) {
         // make a fake fcx
-        let v: @mutable node_id[] = @mutable ~[];
+        let v: @mutable [node_id] = @mutable ~[];
         let fake_fcx =
             {enclosing:
                  {constrs: @new_def_hash[constraint](),
@@ -115,7 +115,7 @@ fn find_pre_post_item(ccx: &crate_ctxt, i: &item) {
    sets the precondition in a to be the result of combining
    the preconditions for <args>, and the postcondition in a to
    be the union of all postconditions for <args> */
-fn find_pre_post_exprs(fcx: &fn_ctxt, args: &(@expr)[], id: node_id) {
+fn find_pre_post_exprs(fcx: &fn_ctxt, args: &[@expr], id: node_id) {
     if ivec::len[@expr](args) > 0u {
         log "find_pre_post_exprs: oper =";
         log_expr(*args.(0));
@@ -692,7 +692,7 @@ fn do_one_(fcx: fn_ctxt, s: &@stmt) {
     let do_inner = bind do_inner_(fcx, _);
     option::map[@expr, ()](do_inner, b.node.expr);
 
-    let pps: pre_and_post[] = ~[];
+    let pps: [pre_and_post] = ~[];
     for s: @stmt  in b.node.stmts { pps += ~[stmt_pp(fcx.ccx, *s)]; }
     alt b.node.expr {
       none. {/* no-op */ }
@@ -732,7 +732,7 @@ fn find_pre_post_fn(fcx: &fn_ctxt, f: &_fn) {
     }
 }
 
-fn fn_pre_post(f: &_fn, tps: &ty_param[], sp: &span, i: &fn_ident,
+fn fn_pre_post(f: &_fn, tps: &[ty_param], sp: &span, i: &fn_ident,
                id: node_id, ccx: &crate_ctxt, v: &visit::vt[crate_ctxt]) {
     visit::visit_fn(f, tps, sp, i, id, ccx, v);
     assert (ccx.fm.contains_key(id));
index 420ea4cad8c441e351c669f62dca186f2c096a99..e1ceb06252425ee908d02fbed3ba9b95ddbd28be 100644 (file)
@@ -47,7 +47,7 @@ fn handle_move_or_copy(fcx: &fn_ctxt, post: &poststate, rhs_path: &path,
     }
 }
 
-fn seq_states(fcx: &fn_ctxt, pres: &prestate, bindings: &binding[])
+fn seq_states(fcx: &fn_ctxt, pres: &prestate, bindings: &[binding])
     -> {changed: bool, post: poststate} {
     let changed = false;
     let post = tritv_clone(pres);
@@ -163,7 +163,7 @@ fn find_pre_post_state_two(fcx: &fn_ctxt, pres: &prestate, lhs: &@expr,
 }
 
 fn find_pre_post_state_call(fcx: &fn_ctxt, pres: &prestate, a: &@expr,
-                            id: node_id, ops: &init_op[], bs: &(@expr)[],
+                            id: node_id, ops: &[init_op], bs: &[@expr],
                             cf: controlflow) -> bool {
     let changed = find_pre_post_state_expr(fcx, pres, a);
     if ivec::len(bs) != ivec::len(ops) {
@@ -178,7 +178,7 @@ fn find_pre_post_state_call(fcx: &fn_ctxt, pres: &prestate, a: &@expr,
 }
 
 fn find_pre_post_state_exprs(fcx: &fn_ctxt, pres: &prestate, id: node_id,
-                             ops: &init_op[], es: &(@expr)[],
+                             ops: &[init_op], es: &[@expr],
                              cf: controlflow) -> bool {
     let rs = seq_states(fcx, pres, anon_bindings(ops, es));
     let changed = rs.changed | set_prestate_ann(fcx.ccx, id, pres);
index 1d33292c9a9f988ee4c9c418ac6afdb20ee3fc24..998e20e19a3c90d447c9ee25d4fce30335a5e8b6 100644 (file)
@@ -239,9 +239,9 @@ fn tritv_doesntcare(v: &t) -> bool {
     ret true;
 }
 
-fn to_vec(v: &t) -> uint[] {
+fn to_vec(v: &t) -> [uint] {
     let i: uint = 0u;
-    let rslt: uint[] = ~[];
+    let rslt: [uint] = ~[];
     while i < v.nbits {
         rslt +=
             ~[alt tritv_get(v, i) {
index eba4d8ccc60c4598996b12cb058ff65b290d548d..7a7bea34b8dac9f7d6b67bcc32331a0645bc141f 100644 (file)
 type method =
     {proto: ast::proto,
      ident: ast::ident,
-     inputs: arg[],
+     inputs: [arg],
      output: t,
      cf: controlflow,
-     constrs: (@constr)[]};
+     constrs: [@constr]};
 
-type constr_table = hashmap[ast::node_id, constr[]];
+type constr_table = hashmap[ast::node_id, [constr]];
 
 type mt = {ty: t, mut: ast::mutability};
 
@@ -263,7 +263,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
     ty_char;
     ty_str;
     ty_istr;
-    ty_tag(def_id, t[]);
+    ty_tag(def_id, [t]);
     ty_box(mt);
     ty_vec(mt);
     ty_ivec(mt);
@@ -271,18 +271,18 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
     ty_port(t);
     ty_chan(t);
     ty_task;
-    ty_rec(field[]);
-    ty_fn(ast::proto, arg[], t, controlflow, (@constr)[]);
-    ty_native_fn(ast::native_abi, arg[], t);
-    ty_obj(method[]);
-    ty_res(def_id, t, t[]);
+    ty_rec([field]);
+    ty_fn(ast::proto, [arg], t, controlflow, [@constr]);
+    ty_native_fn(ast::native_abi, [arg], t);
+    ty_obj([method]);
+    ty_res(def_id, t, [t]);
     ty_var(int); // type variable
 
     ty_param(uint, ast::kind); // fn/tag type param
 
     ty_type;
     ty_native(def_id);
-    ty_constr(t, (@type_constr)[]);
+    ty_constr(t, [@type_constr]);
     // TODO: ty_fn_arg(t), for a possibly-aliased function argument
 }
 
@@ -309,7 +309,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
     terr_constr_mismatch(@type_constr, @type_constr);
 }
 
-type ty_param_kinds_and_ty = {kinds: ast::kind[], ty: t};
+type ty_param_kinds_and_ty = {kinds: [ast::kind], ty: t};
 
 type type_cache = hashmap[ast::def_id, ty_param_kinds_and_ty];
 
@@ -359,7 +359,7 @@ fn method_ty_to_fn_ty(cx: &ctxt, m: method) -> t {
 
 type type_store = interner::interner[@raw_t];
 
-type ty_param_substs_opt_and_ty = {substs: option::t[ty::t[]], ty: ty::t};
+type ty_param_substs_opt_and_ty = {substs: option::t[[ty::t]], ty: ty::t};
 
 type node_type_table =
     @smallintmap::smallintmap[ty::ty_param_substs_opt_and_ty];
@@ -447,7 +447,7 @@ fn derive_flags_arg(cx: &ctxt, has_params: &mutable bool,
         derive_flags_t(cx, has_params, has_vars, a.ty);
     }
     fn derive_flags_sig(cx: &ctxt, has_params: &mutable bool,
-                        has_vars: &mutable bool, args: &arg[], tt: &t) {
+                        has_vars: &mutable bool, args: &[arg], tt: &t) {
         for a: arg  in args { derive_flags_arg(cx, has_params, has_vars, a); }
         derive_flags_t(cx, has_params, has_vars, tt);
     }
@@ -552,7 +552,7 @@ fn mk_mach(cx: &ctxt, tm: &ast::ty_mach) -> t {
 
 fn mk_istr(cx: &ctxt) -> t { ret idx_istr; }
 
-fn mk_tag(cx: &ctxt, did: &ast::def_id, tys: &t[]) -> t {
+fn mk_tag(cx: &ctxt, did: &ast::def_id, tys: &[t]) -> t {
     ret gen_ty(cx, ty_tag(did, tys));
 }
 
@@ -582,9 +582,9 @@ fn mk_imm_vec(cx: &ctxt, typ: &t) -> t {
 
 fn mk_task(cx: &ctxt) -> t { ret gen_ty(cx, ty_task); }
 
-fn mk_rec(cx: &ctxt, fs: &field[]) -> t { ret gen_ty(cx, ty_rec(fs)); }
+fn mk_rec(cx: &ctxt, fs: &[field]) -> t { ret gen_ty(cx, ty_rec(fs)); }
 
-fn mk_imm_tup(cx: &ctxt, tys: &t[]) -> t {
+fn mk_imm_tup(cx: &ctxt, tys: &[t]) -> t {
     let fields = ~[];
     let i = 0u;
     for typ: t  in tys {
@@ -594,22 +594,22 @@ fn mk_imm_tup(cx: &ctxt, tys: &t[]) -> t {
     ret gen_ty(cx, ty_rec(fields));
 }
 
-fn mk_constr(cx: &ctxt, t: &t, cs: &(@type_constr)[]) -> t {
+fn mk_constr(cx: &ctxt, t: &t, cs: &[@type_constr]) -> t {
     ret gen_ty(cx, ty_constr(t, cs));
 }
 
-fn mk_fn(cx: &ctxt, proto: &ast::proto, args: &arg[], ty: &t,
-         cf: &controlflow, constrs: &(@constr)[]) -> t {
+fn mk_fn(cx: &ctxt, proto: &ast::proto, args: &[arg], ty: &t,
+         cf: &controlflow, constrs: &[@constr]) -> t {
     ret gen_ty(cx, ty_fn(proto, args, ty, cf, constrs));
 }
 
-fn mk_native_fn(cx: &ctxt, abi: &ast::native_abi, args: &arg[], ty: &t) -> t {
+fn mk_native_fn(cx: &ctxt, abi: &ast::native_abi, args: &[arg], ty: &t) -> t {
     ret gen_ty(cx, ty_native_fn(abi, args, ty));
 }
 
-fn mk_obj(cx: &ctxt, meths: &method[]) -> t { ret gen_ty(cx, ty_obj(meths)); }
+fn mk_obj(cx: &ctxt, meths: &[method]) -> t { ret gen_ty(cx, ty_obj(meths)); }
 
-fn mk_res(cx: &ctxt, did: &ast::def_id, inner: &t, tps: &t[]) -> t {
+fn mk_res(cx: &ctxt, did: &ast::def_id, inner: &t, tps: &[t]) -> t {
     ret gen_ty(cx, ty_res(did, inner, tps));
 }
 
@@ -759,12 +759,12 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
         ty = copy_cname(cx, mk_chan(cx, fold_ty(cx, fld, subty)), ty);
       }
       ty_tag(tid, subtys) {
-        let new_subtys: t[] = ~[];
+        let new_subtys: [t] = ~[];
         for subty: t  in subtys { new_subtys += ~[fold_ty(cx, fld, subty)]; }
         ty = copy_cname(cx, mk_tag(cx, tid, new_subtys), ty);
       }
       ty_rec(fields) {
-        let new_fields: field[] = ~[];
+        let new_fields: [field] = ~[];
         for fl: field  in fields {
             let new_ty = fold_ty(cx, fld, fl.mt.ty);
             let new_mt = {ty: new_ty, mut: fl.mt.mut};
@@ -773,7 +773,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
         ty = copy_cname(cx, mk_rec(cx, new_fields), ty);
       }
       ty_fn(proto, args, ret_ty, cf, constrs) {
-        let new_args: arg[] = ~[];
+        let new_args: [arg] = ~[];
         for a: arg  in args {
             let new_ty = fold_ty(cx, fld, a.ty);
             new_args += ~[{mode: a.mode, ty: new_ty}];
@@ -784,7 +784,7 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
                              cf, constrs), ty);
       }
       ty_native_fn(abi, args, ret_ty) {
-        let new_args: arg[] = ~[];
+        let new_args: [arg] = ~[];
         for a: arg  in args {
             let new_ty = fold_ty(cx, fld, a.ty);
             new_args += ~[{mode: a.mode, ty: new_ty}];
@@ -795,9 +795,9 @@ fn fold_ty(cx: &ctxt, fld: fold_mode, ty_0: t) -> t {
                                     fold_ty(cx, fld, ret_ty)), ty);
       }
       ty_obj(methods) {
-        let new_methods: method[] = ~[];
+        let new_methods: [method] = ~[];
         for m: method  in methods {
-            let new_args: arg[] = ~[];
+            let new_args: [arg] = ~[];
             for a: arg  in m.inputs {
                 new_args += ~[{mode: a.mode, ty: fold_ty(cx, fld, a.ty)}];
             }
@@ -1401,8 +1401,8 @@ fn type_param(cx: &ctxt, ty: &t) -> option::t[uint] {
 
 // Returns an ivec of all the type variables
 // occurring in t. It may contain duplicates.
-fn vars_in_type(cx:&ctxt, ty: &t) -> int[] {
-    fn collect_var(cx:&ctxt, vars: &@mutable int[], ty: t) {
+fn vars_in_type(cx:&ctxt, ty: &t) -> [int] {
+    fn collect_var(cx:&ctxt, vars: &@mutable [int], ty: t) {
         alt struct(cx, ty) {
           ty_var(v) {
             *vars += ~[v];
@@ -1410,7 +1410,7 @@ fn collect_var(cx:&ctxt, vars: &@mutable int[], ty: t) {
           _ {}
         }
     }
-    let rslt: @mutable int[] = @mutable (~[]);
+    let rslt: @mutable [int] = @mutable (~[]);
     walk_ty(cx, bind collect_var(cx, rslt, _), ty);
     // Works because of a "convenient" bug that lets us
     // return a mutable ivec as if it's immutable
@@ -1463,7 +1463,7 @@ fn hash_type_constr(id: uint, c: &@type_constr) -> uint {
         h += h << 5u + hash_def(h, c.node.id);
         ret hash_type_constr_args(h, c.node.args);
     }
-    fn hash_type_constr_args(id: uint, args: (@ty_constr_arg)[]) -> uint {
+    fn hash_type_constr_args(id: uint, args: [@ty_constr_arg]) -> uint {
         let h = id;
         for a: @ty_constr_arg  in args {
             alt a.node {
@@ -1482,7 +1482,7 @@ fn hash_type_constr_args(id: uint, args: (@ty_constr_arg)[]) -> uint {
     }
 
 
-    fn hash_fn(id: uint, args: &arg[], rty: &t) -> uint {
+    fn hash_fn(id: uint, args: &[arg], rty: &t) -> uint {
         let h = id;
         for a: arg  in args { h += h << 5u + hash_ty(a.ty); }
         h += h << 5u + hash_ty(rty);
@@ -1590,8 +1590,8 @@ fn arg_eq[T](eq: &fn(&T, &T) -> bool , a: @sp_constr_arg[T],
     }
 }
 
-fn args_eq[T](eq: fn(&T, &T) -> bool , a: &(@sp_constr_arg[T])[],
-              b: &(@sp_constr_arg[T])[]) -> bool {
+fn args_eq[T](eq: fn(&T, &T) -> bool , a: &[@sp_constr_arg[T]],
+              b: &[@sp_constr_arg[T]]) -> bool {
     let i: uint = 0u;
     for arg: @sp_constr_arg[T]  in a {
         if !arg_eq(eq, arg, b.(i)) { ret false; }
@@ -1606,7 +1606,7 @@ fn constr_eq(c: &@constr, d: &@constr) -> bool {
             args_eq(eq_int, c.node.args, d.node.args);
 }
 
-fn constrs_eq(cs: &(@constr)[], ds: &(@constr)[]) -> bool {
+fn constrs_eq(cs: &[@constr], ds: &[@constr]) -> bool {
     if ivec::len(cs) != ivec::len(ds) { ret false; }
     let i = 0u;
     for c: @constr  in cs { if !constr_eq(c, ds.(i)) { ret false; } i += 1u; }
@@ -1617,7 +1617,7 @@ fn equal_type_structures(a: &sty, b: &sty) -> bool {
     fn equal_mt(a: &mt, b: &mt) -> bool {
         ret a.mut == b.mut && eq_ty(a.ty, b.ty);
     }
-    fn equal_fn(args_a: &arg[], rty_a: &t, args_b: &arg[], rty_b: &t) ->
+    fn equal_fn(args_a: &[arg], rty_a: &t, args_b: &[arg], rty_b: &t) ->
        bool {
         if !eq_ty(rty_a, rty_b) { ret false; }
         let len = ivec::len[arg](args_a);
@@ -1832,7 +1832,7 @@ fn node_id_to_type(cx: &ctxt, id: &ast::node_id) -> t {
     ret node_id_to_ty_param_substs_opt_and_ty(cx, id).ty;
 }
 
-fn node_id_to_type_params(cx: &ctxt, id: &ast::node_id) -> t[] {
+fn node_id_to_type_params(cx: &ctxt, id: &ast::node_id) -> [t] {
     alt node_id_to_ty_param_substs_opt_and_ty(cx, id).substs {
       none. { ret ~[]; }
       some(tps) { ret tps; }
@@ -1865,7 +1865,7 @@ fn node_id_to_monotype(cx: &ctxt, id: ast::node_id) -> t {
 
 // Returns the number of distinct type parameters in the given type.
 fn count_ty_params(cx: &ctxt, ty: t) -> uint {
-    fn counter(cx: &ctxt, param_indices: @mutable uint[], ty: t) {
+    fn counter(cx: &ctxt, param_indices: @mutable [uint], ty: t) {
         alt struct(cx, ty) {
           ty_param(param_idx,_) {
             let seen = false;
@@ -1877,7 +1877,7 @@ fn counter(cx: &ctxt, param_indices: @mutable uint[], ty: t) {
           _ {/* fall through */ }
         }
     }
-    let param_indices: @mutable uint[] = @mutable ~[];
+    let param_indices: @mutable [uint] = @mutable ~[];
     let f = bind counter(cx, param_indices, _);
     walk_ty(cx, f, ty);
     ret ivec::len[uint](*param_indices);
@@ -1893,7 +1893,7 @@ fn type_contains_params(cx: &ctxt, typ: &t) -> bool {
 
 
 // Type accessors for substructures of types
-fn ty_fn_args(cx: &ctxt, fty: &t) -> arg[] {
+fn ty_fn_args(cx: &ctxt, fty: &t) -> [arg] {
     alt struct(cx, fty) {
       ty::ty_fn(_, a, _, _, _) { ret a; }
       ty::ty_native_fn(_, a, _) { ret a; }
@@ -1963,7 +1963,7 @@ fn expr_ty(cx: &ctxt, expr: &@ast::expr) -> t {
 }
 
 fn expr_ty_params_and_ty(cx: &ctxt, expr: &@ast::expr) ->
-   {params: t[], ty: t} {
+   {params: [t], ty: t} {
     ret {params: node_id_to_type_params(cx, expr.id),
          ty: node_id_to_type(cx, expr.id)};
 }
@@ -1984,20 +1984,20 @@ fn stmt_node_id(s: &@ast::stmt) -> ast::node_id {
 }
 
 fn field_idx(sess: &session::session, sp: &span, id: &ast::ident,
-             fields: &field[]) -> uint {
+             fields: &[field]) -> uint {
     let i: uint = 0u;
     for f: field  in fields { if str::eq(f.ident, id) { ret i; } i += 1u; }
     sess.span_fatal(sp, "unknown field '" + id + "' of record");
 }
 
 fn method_idx(sess: &session::session, sp: &span, id: &ast::ident,
-              meths: &method[]) -> uint {
+              meths: &[method]) -> uint {
     let i: uint = 0u;
     for m: method  in meths { if str::eq(m.ident, id) { ret i; } i += 1u; }
     sess.span_fatal(sp, "unknown method '" + id + "' of obj");
 }
 
-fn sort_methods(meths: &method[]) -> method[] {
+fn sort_methods(meths: &[method]) -> [method] {
     fn method_lteq(a: &method, b: &method) -> bool {
         ret str::lteq(a.ident, b.ident);
     }
@@ -2151,8 +2151,8 @@ fn struct_cmp(cx: @ctxt, expected: t, actual: t) -> result {
 
     // Right now this just checks that the lists of constraints are
     // pairwise equal.
-    fn unify_constrs(base_t: &t, expected: (@type_constr)[],
-                     actual: &(@type_constr)[]) -> result {
+    fn unify_constrs(base_t: &t, expected: [@type_constr],
+                     actual: &[@type_constr]) -> result {
         let expected_len = ivec::len(expected);
         let actual_len = ivec::len(actual);
 
@@ -2212,11 +2212,11 @@ fn unify_mut(expected: ast::mutability, actual: ast::mutability) ->
     }
     tag fn_common_res {
         fn_common_res_err(result);
-        fn_common_res_ok(arg[], t);
+        fn_common_res_ok([arg], t);
     }
     fn unify_fn_common(cx: &@ctxt, expected: &t, actual: &t,
-                       expected_inputs: &arg[], expected_output: &t,
-                       actual_inputs: &arg[], actual_output: &t) ->
+                       expected_inputs: &[arg], expected_output: &t,
+                       actual_inputs: &[arg], actual_output: &t) ->
        fn_common_res {
         let expected_len = ivec::len[arg](expected_inputs);
         let actual_len = ivec::len[arg](actual_inputs);
@@ -2225,7 +2225,7 @@ fn unify_fn_common(cx: &@ctxt, expected: &t, actual: &t,
         }
         // TODO: as above, we should have an iter2 iterator.
 
-        let result_ins: arg[] = ~[];
+        let result_ins: [arg] = ~[];
         let i = 0u;
         while i < expected_len {
             let expected_input = expected_inputs.(i);
@@ -2254,10 +2254,10 @@ fn unify_fn_common(cx: &@ctxt, expected: &t, actual: &t,
         }
     }
     fn unify_fn(cx: &@ctxt, e_proto: &ast::proto, a_proto: &ast::proto,
-                expected: &t, actual: &t, expected_inputs: &arg[],
-                expected_output: &t, actual_inputs: &arg[], actual_output: &t,
+                expected: &t, actual: &t, expected_inputs: &[arg],
+                expected_output: &t, actual_inputs: &[arg], actual_output: &t,
                 expected_cf: &controlflow, actual_cf: &controlflow,
-                expected_constrs: &(@constr)[], actual_constrs: &(@constr)[])
+                expected_constrs: &[@constr], actual_constrs: &[@constr])
        -> result {
         if e_proto != a_proto { ret ures_err(terr_mismatch); }
         alt expected_cf {
@@ -2296,8 +2296,8 @@ fn unify_fn(cx: &@ctxt, e_proto: &ast::proto, a_proto: &ast::proto,
     }
     fn unify_native_fn(cx: &@ctxt, e_abi: &ast::native_abi,
                        a_abi: &ast::native_abi, expected: &t, actual: &t,
-                       expected_inputs: &arg[], expected_output: &t,
-                       actual_inputs: &arg[], actual_output: &t) -> result {
+                       expected_inputs: &[arg], expected_output: &t,
+                       actual_inputs: &[arg], actual_output: &t) -> result {
         if e_abi != a_abi { ret ures_err(terr_mismatch); }
         let t =
             unify_fn_common(cx, expected, actual, expected_inputs,
@@ -2311,9 +2311,9 @@ fn unify_native_fn(cx: &@ctxt, e_abi: &ast::native_abi,
         }
     }
     fn unify_obj(cx: &@ctxt, expected: &t, actual: &t,
-                 expected_meths: &method[], actual_meths: &method[]) ->
+                 expected_meths: &[method], actual_meths: &[method]) ->
        result {
-        let result_meths: method[] = ~[];
+        let result_meths: [method] = ~[];
         let i: uint = 0u;
         let expected_len: uint = ivec::len[method](expected_meths);
         let actual_len: uint = ivec::len[method](actual_meths);
@@ -2455,7 +2455,7 @@ fn unify_step(cx: &@ctxt, expected: &t, actual: &t) -> result {
                     ret ures_err(terr_mismatch);
                 }
                 // TODO: factor this cruft out
-                let result_tps: t[] = ~[];
+                let result_tps: [t] = ~[];
                 let i = 0u;
                 let expected_len = ivec::len[t](expected_tps);
                 while i < expected_len {
@@ -2621,7 +2621,7 @@ fn unify_step(cx: &@ctxt, expected: &t, actual: &t) -> result {
                 // TODO: implement an iterator that can iterate over
                 // two arrays simultaneously.
 
-                let result_fields: field[] = ~[];
+                let result_fields: [field] = ~[];
                 let i = 0u;
                 while i < expected_len {
                     let expected_field = expected_fields.(i);
@@ -2836,11 +2836,11 @@ fn type_err_to_str(err: &ty::type_err) -> str {
 // Converts type parameters in a type to type variables and returns the
 // resulting type along with a list of type variable IDs.
 fn bind_params_in_type(sp: &span, cx: &ctxt, next_ty_var: fn() -> int ,
-                       typ: t, ty_param_count: uint) -> {ids: int[], ty: t} {
-    let param_var_ids: @mutable int[] = @mutable ~[];
+                       typ: t, ty_param_count: uint) -> {ids: [int], ty: t} {
+    let param_var_ids: @mutable [int] = @mutable ~[];
     let i = 0u;
     while i < ty_param_count { *param_var_ids += ~[next_ty_var()]; i += 1u; }
-    fn binder(sp: span, cx: ctxt, param_var_ids: @mutable int[],
+    fn binder(sp: span, cx: ctxt, param_var_ids: @mutable [int],
               next_ty_var: fn() -> int , index: uint, kind: ast::kind) -> t {
         if index < ivec::len(*param_var_ids) {
             ret mk_var(cx, param_var_ids.(index));
@@ -2859,9 +2859,9 @@ fn binder(sp: span, cx: ctxt, param_var_ids: @mutable int[],
 
 // Replaces type parameters in the given type using the given list of
 // substitions.
-fn substitute_type_params(cx: &ctxt, substs: &ty::t[], typ: t) -> t {
+fn substitute_type_params(cx: &ctxt, substs: &[ty::t], typ: t) -> t {
     if !type_contains_params(cx, typ) { ret typ; }
-    fn substituter(cx: ctxt, substs: @ty::t[], idx: uint,
+    fn substituter(cx: ctxt, substs: @[ty::t], idx: uint,
                    kind: ast::kind) -> t {
         // FIXME: bounds check can fail
         ret substs.(idx);
@@ -2889,9 +2889,9 @@ fn def_has_ty_params(def: &ast::def) -> bool {
 
 
 // Tag information
-type variant_info = {args: ty::t[], ctor_ty: ty::t, id: ast::def_id};
+type variant_info = {args: [ty::t], ctor_ty: ty::t, id: ast::def_id};
 
-fn tag_variants(cx: &ctxt, id: &ast::def_id) -> variant_info[] {
+fn tag_variants(cx: &ctxt, id: &ast::def_id) -> [variant_info] {
     if ast::local_crate != id.crate { ret csearch::get_tag_variants(cx, id); }
     let item =
         alt cx.items.find(id.node) {
@@ -2902,10 +2902,10 @@ fn tag_variants(cx: &ctxt, id: &ast::def_id) -> variant_info[] {
       ast_map::node_item(item) {
         alt item.node {
           ast::item_tag(variants, _) {
-            let result: variant_info[] = ~[];
+            let result: [variant_info] = ~[];
             for variant: ast::variant  in variants {
                 let ctor_ty = node_id_to_monotype(cx, variant.node.id);
-                let arg_tys: t[] = ~[];
+                let arg_tys: [t] = ~[];
                 if std::ivec::len(variant.node.args) > 0u {
                     for a: arg  in ty_fn_args(cx, ctor_ty) {
                         arg_tys += ~[a.ty];
index b88f761deded2e88757dad83b896a830ca246ede..4ac3c866352c0fa67b7c5b1b7f16b0b312194739 100644 (file)
 // Used for typechecking the methods of an object.
 tag obj_info {
     // Regular objects have a node_id at compile time.
-    regular_obj(ast::obj_field[], ast::node_id);
+    regular_obj([ast::obj_field], ast::node_id);
     // Anonymous objects only have a type at compile time.  It's optional
     // because not all anonymous objects have a inner_obj to attach to.
-    anon_obj(ast::obj_field[], option::t[ty::sty]);
+    anon_obj([ast::obj_field], option::t[ty::sty]);
 }
 
-type crate_ctxt = {mutable obj_infos: obj_info[], tcx: ty::ctxt};
+type crate_ctxt = {mutable obj_infos: [obj_info], tcx: ty::ctxt};
 
 type fn_ctxt =
     // var_bindings, locals, local_names, and next_var_id are shared
@@ -73,7 +73,7 @@
      locals: hashmap[ast::node_id, int],
      local_names: hashmap[ast::node_id, ast::ident],
      next_var_id: @mutable int,
-     mutable fixups: ast::node_id[],
+     mutable fixups: [ast::node_id],
      ccx: @crate_ctxt};
 
 
@@ -110,7 +110,7 @@ fn ident_for_local(loc: &@ast::local) -> ast::ident {
 // Returns the type parameter count and the type for the given definition.
 fn ty_param_kinds_and_ty_for_def(fcx: &@fn_ctxt, sp: &span, defn: &ast::def)
    -> ty_param_kinds_and_ty {
-    let no_kinds: ast::kind[] = ~[];
+    let no_kinds: [ast::kind] = ~[];
     alt defn {
       ast::def_arg(id) {
         assert (fcx.locals.contains_key(id.node));
@@ -176,7 +176,7 @@ fn instantiate_path(fcx: &@fn_ctxt, pth: &ast::path,
             fcx.ccx.tcx.sess.span_fatal
                 (sp, "not enough type parameters provided for this item");
         }
-        let ty_substs: ty::t[] = ~[];
+        let ty_substs: [ty::t] = ~[];
         let i = 0u;
         while i < ty_substs_len {
             let ty_var = ty::mk_var(fcx.ccx.tcx, ty_param_vars.(i));
@@ -185,7 +185,7 @@ fn instantiate_path(fcx: &@fn_ctxt, pth: &ast::path,
             ty_substs += ~[res_ty];
             i += 1u;
         }
-        ty_substs_opt = some[ty::t[]](ty_substs);
+        ty_substs_opt = some[[ty::t]](ty_substs);
         if ty_param_count == 0u {
             fcx.ccx.tcx.sess.span_fatal(sp,
                                         "this item does not take type \
@@ -193,13 +193,13 @@ fn instantiate_path(fcx: &@fn_ctxt, pth: &ast::path,
         }
     } else {
         // We will acquire the type parameters through unification.
-        let ty_substs: ty::t[] = ~[];
+        let ty_substs: [ty::t] = ~[];
         let i = 0u;
         while i < ty_param_count {
             ty_substs += ~[ty::mk_var(fcx.ccx.tcx, ty_param_vars.(i))];
             i += 1u;
         }
-        ty_substs_opt = some[ty::t[]](ty_substs);
+        ty_substs_opt = some[[ty::t]](ty_substs);
     }
     ret {substs: ty_substs_opt, ty: tpt.ty};
 }
@@ -281,7 +281,7 @@ fn ast_mt_to_mt(tcx: &ty::ctxt, getter: &ty_getter, mt: &ast::mt) ->
         ret {ty: ast_ty_to_ty(tcx, getter, mt.ty), mut: mt.mut};
     }
     fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
-                   id: &ast::def_id, args: &(@ast::ty)[]) -> ty::t {
+                   id: &ast::def_id, args: &[@ast::ty]) -> ty::t {
         // TODO: maybe record cname chains so we can do
         // "foo = int" like OCaml?
 
@@ -292,7 +292,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
         // The typedef is type-parametric. Do the type substitution.
         //
 
-        let param_bindings: ty::t[] = ~[];
+        let param_bindings: [ty::t] = ~[];
         for ast_ty: @ast::ty  in args {
             param_bindings += ~[ast_ty_to_ty(tcx, getter, ast_ty)];
         }
@@ -340,7 +340,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
         typ = ty::mk_chan(tcx, ast_ty_to_ty(tcx, getter, t));
       }
       ast::ty_rec(fields) {
-        let flds: field[] = ~[];
+        let flds: [field] = ~[];
         for f: ast::ty_field  in fields {
             let tm = ast_mt_to_mt(tcx, getter, f.node.mt);
             flds += ~[{ident: f.node.ident, mt: tm}];
@@ -378,7 +378,7 @@ fn instantiate(tcx: &ty::ctxt, sp: &span, getter: &ty_getter,
         cname = some(path_to_str(path));
       }
       ast::ty_obj(meths) {
-        let tmeths: ty::method[] = ~[];
+        let tmeths: [ty::method] = ~[];
         for m: ast::ty_method  in meths {
             let ins = ~[];
             for ta: ast::ty_arg  in m.node.inputs {
@@ -457,23 +457,23 @@ fn ty_fixup(fcx: @fn_ctxt, node_id: ast::node_id,
 
     // Writes a type with no type parameters into the node type table.
     fn ty_only(tcx: &ty::ctxt, node_id: ast::node_id, typ: ty::t) {
-        ty(tcx, node_id, {substs: none[ty::t[]], ty: typ});
+        ty(tcx, node_id, {substs: none[[ty::t]], ty: typ});
     }
 
     // Writes a type with no type parameters into the node type table. This
     // function allows for the possibility of type variables.
     fn ty_only_fixup(fcx: @fn_ctxt, node_id: ast::node_id, typ: ty::t) {
-        ret ty_fixup(fcx, node_id, {substs: none[ty::t[]], ty: typ});
+        ret ty_fixup(fcx, node_id, {substs: none[[ty::t]], ty: typ});
     }
 
     // Writes a nil type into the node type table.
     fn nil_ty(tcx: &ty::ctxt, node_id: ast::node_id) {
-        ret ty(tcx, node_id, {substs: none[ty::t[]], ty: ty::mk_nil(tcx)});
+        ret ty(tcx, node_id, {substs: none[[ty::t]], ty: ty::mk_nil(tcx)});
     }
 
     // Writes the bottom type into the node type table.
     fn bot_ty(tcx: &ty::ctxt, node_id: ast::node_id) {
-        ret ty(tcx, node_id, {substs: none[ty::t[]], ty: ty::mk_bot(tcx)});
+        ret ty(tcx, node_id, {substs: none[[ty::t]], ty: ty::mk_bot(tcx)});
     }
 }
 
@@ -504,7 +504,7 @@ fn proto_to_ty_proto(proto: &ast::proto) -> ast::proto {
 mod collect {
     type ctxt = {tcx: ty::ctxt};
 
-    fn mk_ty_params(cx: &@ctxt, atps: &ast::ty_param[]) -> ty::t[] {
+    fn mk_ty_params(cx: &@ctxt, atps: &[ast::ty_param]) -> [ty::t] {
         let tps = ~[];
         let i = 0u;
         for atp: ast::ty_param in atps {
@@ -514,8 +514,8 @@ fn mk_ty_params(cx: &@ctxt, atps: &ast::ty_param[]) -> ty::t[] {
         ret tps;
     }
 
-    fn ty_param_kinds(tps: &ast::ty_param[]) -> ast::kind[] {
-        let k: ast::kind[] = ~[];
+    fn ty_param_kinds(tps: &[ast::ty_param]) -> [ast::kind] {
+        let k: [ast::kind] = ~[];
         for p: ast::ty_param in tps {
             k += ~[p.kind]
         }
@@ -524,7 +524,7 @@ fn ty_param_kinds(tps: &ast::ty_param[]) -> ast::kind[] {
 
     fn ty_of_fn_decl(cx: &@ctxt, convert: &fn(&@ast::ty) -> ty::t ,
                      ty_of_arg: &fn(&ast::arg) -> arg , decl: &ast::fn_decl,
-                     proto: ast::proto, ty_params: &ast::ty_param[],
+                     proto: ast::proto, ty_params: &[ast::ty_param],
                      def_id: &option::t[ast::def_id]) ->
        ty::ty_param_kinds_and_ty {
         let input_tys = ~[];
@@ -545,7 +545,7 @@ fn ty_of_fn_decl(cx: &@ctxt, convert: &fn(&@ast::ty) -> ty::t ,
     fn ty_of_native_fn_decl(cx: &@ctxt, convert: &fn(&@ast::ty) -> ty::t ,
                             ty_of_arg: &fn(&ast::arg) -> arg ,
                             decl: &ast::fn_decl, abi: ast::native_abi,
-                            ty_params: &ast::ty_param[], def_id: &ast::def_id)
+                            ty_params: &[ast::ty_param], def_id: &ast::def_id)
        -> ty::ty_param_kinds_and_ty {
         let input_tys = ~[];
         for a: ast::arg  in decl.inputs { input_tys += ~[ty_of_arg(a)]; }
@@ -611,18 +611,18 @@ fn ty_of_method(cx: @ctxt, m: &@ast::method) -> ty::method {
              constrs: out_constrs};
     }
     fn ty_of_obj(cx: @ctxt, id: &ast::ident, ob: &ast::_obj,
-                 ty_params: &ast::ty_param[]) -> ty::ty_param_kinds_and_ty {
+                 ty_params: &[ast::ty_param]) -> ty::ty_param_kinds_and_ty {
         let methods = get_obj_method_types(cx, ob);
         let t_obj = ty::mk_obj(cx.tcx, ty::sort_methods(methods));
         t_obj = ty::rename(cx.tcx, t_obj, id);
         ret {kinds: ty_param_kinds(ty_params), ty: t_obj};
     }
     fn ty_of_obj_ctor(cx: @ctxt, id: &ast::ident, ob: &ast::_obj,
-                      ctor_id: ast::node_id, ty_params: &ast::ty_param[]) ->
+                      ctor_id: ast::node_id, ty_params: &[ast::ty_param]) ->
        ty::ty_param_kinds_and_ty {
         let t_obj = ty_of_obj(cx, id, ob, ty_params);
 
-        let t_inputs: arg[] = ~[];
+        let t_inputs: [arg] = ~[];
         for f: ast::obj_field  in ob.fields {
             let g = bind getter(cx, _);
             let t_field = ast_ty_to_ty(cx.tcx, g, f.ty);
@@ -639,7 +639,7 @@ fn ty_of_obj_ctor(cx: @ctxt, id: &ast::ident, ob: &ast::_obj,
     fn ty_of_item(cx: &@ctxt, it: &@ast::item) -> ty::ty_param_kinds_and_ty {
         let get = bind getter(cx, _);
         let convert = bind ast_ty_to_ty(cx.tcx, get, _);
-        let no_kinds: ast::kind[] = ~[];
+        let no_kinds: [ast::kind] = ~[];
         alt it.node {
           ast::item_const(t, _) {
             let typ = convert(t);
@@ -682,7 +682,7 @@ fn ty_of_item(cx: &@ctxt, it: &@ast::item) -> ty::ty_param_kinds_and_ty {
           }
           ast::item_tag(_, tps) {
             // Create a new generic polytype.
-            let subtys: ty::t[] = mk_ty_params(cx, tps);
+            let subtys: [ty::t] = mk_ty_params(cx, tps);
             let t = ty::mk_tag(cx.tcx, local_def(it.id), subtys);
             let tpt = {kinds: ty_param_kinds(tps), ty: t};
             cx.tcx.tcache.insert(local_def(it.id), tpt);
@@ -694,7 +694,7 @@ fn ty_of_item(cx: &@ctxt, it: &@ast::item) -> ty::ty_param_kinds_and_ty {
     }
     fn ty_of_native_item(cx: &@ctxt, it: &@ast::native_item,
                          abi: ast::native_abi) -> ty::ty_param_kinds_and_ty {
-        let no_kinds: ast::kind[] = ~[];
+        let no_kinds: [ast::kind] = ~[];
         alt it.node {
           ast::native_item_fn(_, fn_decl, params) {
             let get = bind getter(cx, _);
@@ -716,11 +716,11 @@ fn ty_of_native_item(cx: &@ctxt, it: &@ast::native_item,
         }
     }
     fn get_tag_variant_types(cx: &@ctxt, tag_id: &ast::def_id,
-                             variants: &ast::variant[],
-                             ty_params: &ast::ty_param[]) {
+                             variants: &[ast::variant],
+                             ty_params: &[ast::ty_param]) {
         // Create a set of parameter types shared among all the variants.
 
-        let ty_param_tys: ty::t[] = mk_ty_params(cx, ty_params);
+        let ty_param_tys: [ty::t] = mk_ty_params(cx, ty_params);
         for variant: ast::variant  in variants {
             // Nullary tag constructors get turned into constants; n-ary tag
             // constructors get turned into functions.
@@ -733,7 +733,7 @@ fn get_tag_variant_types(cx: &@ctxt, tag_id: &ast::def_id,
                 // should be called to resolve named types.
 
                 let f = bind getter(cx, _);
-                let args: arg[] = ~[];
+                let args: [arg] = ~[];
                 for va: ast::variant_arg  in variant.node.args {
                     let arg_ty = ast_ty_to_ty(cx.tcx, f, va.ty);
                     args += ~[{mode: ty::mo_alias(false), ty: arg_ty}];
@@ -749,7 +749,7 @@ fn get_tag_variant_types(cx: &@ctxt, tag_id: &ast::def_id,
             write::ty_only(cx.tcx, variant.node.id, result_ty);
         }
     }
-    fn get_obj_method_types(cx: &@ctxt, object: &ast::_obj) -> ty::method[] {
+    fn get_obj_method_types(cx: &@ctxt, object: &ast::_obj) -> [ty::method] {
         let meths = ~[];
         for m: @ast::method  in object.methods {
             meths += ~[ty_of_method(cx, m)];
@@ -962,7 +962,7 @@ fn resolve_type_vars_if_possible(fcx: &@fn_ctxt, typ: ty::t) -> ty::t {
 
 // Demands - procedures that require that two types unify and emit an error
 // message if they don't.
-type ty_param_substs_and_ty = {substs: ty::t[], ty: ty::t};
+type ty_param_substs_and_ty = {substs: [ty::t], ty: ty::t};
 
 mod demand {
     fn simple(fcx: &@fn_ctxt, sp: &span, expected: &ty::t, actual: &ty::t) ->
@@ -977,7 +977,7 @@ fn autoderef(fcx: &@fn_ctxt, sp: &span, expected: &ty::t, actual: &ty::t,
     // Requires that the two types unify, and prints an error message if they
     // don't. Returns the unified type and the type parameter substitutions.
     fn full(fcx: &@fn_ctxt, sp: &span, expected: &ty::t, actual: &ty::t,
-            ty_param_substs_0: &ty::t[], adk: autoderef_kind) ->
+            ty_param_substs_0: &[ty::t], adk: autoderef_kind) ->
        ty_param_substs_and_ty {
         let expected_1 = expected;
         let actual_1 = actual;
@@ -989,8 +989,8 @@ fn full(fcx: &@fn_ctxt, sp: &span, expected: &ty::t, actual: &ty::t,
         } else if (adk == AUTODEREF_BLOCK_COERCE) {
             actual_1 = do_fn_block_coerce(fcx, sp, actual, expected);
         }
-        let ty_param_substs: ty::t[mutable ] = ~[mutable ];
-        let ty_param_subst_var_ids: int[] = ~[];
+        let ty_param_substs: [mutable ty::t] = ~[mutable];
+        let ty_param_subst_var_ids: [int] = ~[];
         for ty_param_subst: ty::t  in ty_param_substs_0 {
             // Generate a type variable and unify it with the type parameter
             // substitution. We will then pull out these type variables.
@@ -1002,9 +1002,9 @@ fn full(fcx: &@fn_ctxt, sp: &span, expected: &ty::t, actual: &ty::t,
         }
 
         fn mk_result(fcx: &@fn_ctxt, result_ty: &ty::t,
-                     ty_param_subst_var_ids: &int[], implicit_boxes: uint) ->
+                     ty_param_subst_var_ids: &[int], implicit_boxes: uint) ->
            ty_param_substs_and_ty {
-            let result_ty_param_substs: ty::t[] = ~[];
+            let result_ty_param_substs: [ty::t] = ~[];
             for var_id: int  in ty_param_subst_var_ids {
                 let tp_subst = ty::mk_var(fcx.ccx.tcx, var_id);
                 result_ty_param_substs += ~[tp_subst];
@@ -1046,8 +1046,8 @@ fn are_compatible(fcx: &@fn_ctxt, expected: &ty::t, actual: &ty::t) -> bool {
 
 // Returns the types of the arguments to a tag variant.
 fn variant_arg_types(ccx: &@crate_ctxt, sp: &span, vid: &ast::def_id,
-                     tag_ty_params: &ty::t[]) -> ty::t[] {
-    let result: ty::t[] = ~[];
+                     tag_ty_params: &[ty::t]) -> [ty::t] {
+    let result: [ty::t] = ~[];
     let tpt = ty::lookup_item_type(ccx.tcx, vid);
     alt ty::struct(ccx.tcx, tpt.ty) {
       ty::ty_fn(_, ins, _, _, _) {
@@ -1107,16 +1107,16 @@ fn resolve_type_vars_for_node(wbcx: &wb_ctxt, sp: &span,
             };
         let new_substs_opt;
         alt tpot.substs {
-          none[ty::t[]]. { new_substs_opt = none[ty::t[]]; }
-          some[ty::t[]](substs) {
-            let new_substs: ty::t[] = ~[];
+          none[[ty::t]]. { new_substs_opt = none[[ty::t]]; }
+          some[[ty::t]](substs) {
+            let new_substs: [ty::t] = ~[];
             for subst: ty::t  in substs {
                 alt resolve_type_vars_in_type(fcx, sp, subst) {
                   some(t) { new_substs += ~[t]; }
                   none. { wbcx.success = false; ret; }
                 }
             }
-            new_substs_opt = some[ty::t[]](new_substs);
+            new_substs_opt = some[[ty::t]](new_substs);
           }
         }
         write::ty(fcx.ccx.tcx, id, {substs: new_substs_opt, ty: new_ty});
@@ -1296,7 +1296,7 @@ fn gather_locals(ccx: &@crate_ctxt, f: &ast::_fn, id: &ast::node_id,
     };
 
     // Don't descend into fns and items
-    fn visit_fn[E](f: &ast::_fn, tp: &ast::ty_param[], sp: &span,
+    fn visit_fn[E](f: &ast::_fn, tp: &[ast::ty_param], sp: &span,
                    i: &ast::fn_ident, id: ast::node_id, e: &E,
                    v: &visit::vt[E]) { }
     fn visit_item[E](i: &@ast::item, e: &E, v: &visit::vt[E]) { }
@@ -1373,7 +1373,7 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
                 demand::full(fcx, pat.span, expected, ctor_ty, expected_tps,
                              NO_AUTODEREF);
             path_tpot =
-                {substs: some[ty::t[]](path_tpt.substs), ty: path_tpt.ty};
+                {substs: some[[ty::t]](path_tpt.substs), ty: path_tpt.ty};
             // Get the number of arguments in this tag variant.
 
             let arg_types =
@@ -1517,7 +1517,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
     // A generic function to factor out common logic from call and bind
     // expressions.
     fn check_call_or_bind(fcx: &@fn_ctxt, sp: &span, f: &@ast::expr,
-                          args: &(option::t[@ast::expr])[],
+                          args: &[option::t[@ast::expr]],
                           call_kind: call_kind) -> bool {
         // Check the function.
         let bot = check_expr(fcx, f);
@@ -1612,8 +1612,8 @@ fn check_assignment(fcx: &@fn_ctxt, sp: &span, lhs: &@ast::expr,
 
     // A generic function for checking call expressions
     fn check_call(fcx: &@fn_ctxt, sp: &span, f: &@ast::expr,
-                  args: &(@ast::expr)[], call_kind: call_kind) -> bool {
-        let args_opt_0: (option::t[@ast::expr])[] = ~[];
+                  args: &[@ast::expr], call_kind: call_kind) -> bool {
+        let args_opt_0: [option::t[@ast::expr]] = ~[];
         for arg: @ast::expr  in args {
             args_opt_0 += ~[some[@ast::expr](arg)];
         }
@@ -1624,7 +1624,7 @@ fn check_call(fcx: &@fn_ctxt, sp: &span, f: &@ast::expr,
 
     // A generic function for doing all of the checking for call expressions
     fn check_call_full(fcx: &@fn_ctxt, sp: &span, f: &@ast::expr,
-                       args: &(@ast::expr)[], call_kind: call_kind,
+                       args: &[@ast::expr], call_kind: call_kind,
                        id: ast::node_id) -> bool {
         /* here we're kind of hosed, as f can be any expr
         need to restrict it to being an explicit expr_path if we're
@@ -2083,7 +2083,7 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
 
         // Pull the argument and return types out.
         let proto_1;
-        let arg_tys_1: ty::arg[] = ~[];
+        let arg_tys_1: [ty::arg] = ~[];
         let rt_1;
         let fty = expr_ty(tcx, f);
         let t_1;
@@ -2229,7 +2229,7 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
       }
       ast::expr_rec(fields, base) {
         alt base { none. {/* no-op */ } some(b_0) { check_expr(fcx, b_0); } }
-        let fields_t: (spanned[field])[] = ~[];
+        let fields_t: [spanned[field]] = ~[];
         for f: ast::field  in fields {
             bot |= check_expr(fcx, f.node.expr);
             let expr_t = expr_ty(tcx, f.node.expr);
@@ -2249,7 +2249,7 @@ fn get_node(f: &spanned[field]) -> field { f.node }
           some(bexpr) {
             bot |= check_expr(fcx, bexpr);
             let bexpr_t = expr_ty(tcx, bexpr);
-            let base_fields: field[] = ~[];
+            let base_fields: [field] = ~[];
             alt structure_of(fcx, expr.span, bexpr_t) {
               ty::ty_rec(flds) { base_fields = flds; }
               _ {
@@ -2366,7 +2366,7 @@ fn get_node(f: &spanned[field]) -> field { f.node }
         }
       }
       ast::expr_anon_obj(ao) {
-        let fields: ast::anon_obj_field[] = ~[];
+        let fields: [ast::anon_obj_field] = ~[];
         alt ao.fields { none. { } some(v) { fields = v; } }
 
         // FIXME: These next three functions are largely ripped off from
@@ -2399,7 +2399,7 @@ fn ty_of_method(ccx: @crate_ctxt, m: &@ast::method) -> ty::method {
                  constrs: out_constrs};
         }
 
-        let method_types: ty::method[] = ~[];
+        let method_types: [ty::method] = ~[];
         {
             // Outer methods.
             for m: @ast::method  in ao.methods {
@@ -2410,7 +2410,7 @@ fn ty_of_method(ccx: @crate_ctxt, m: &@ast::method) -> ty::method {
 
             // Typecheck 'inner_obj'.  If it exists, it had better have object
             // type.
-            let inner_obj_methods: ty::method[] = ~[];
+            let inner_obj_methods: [ty::method] = ~[];
             let inner_obj_ty: ty::t = ty::mk_nil(tcx);
             let inner_obj_sty: option::t[ty::sty] = none;
             alt ao.inner_obj {
@@ -2448,7 +2448,7 @@ fn ty_of_method(ccx: @crate_ctxt, m: &@ast::method) -> ty::method {
             // any methods that share a name with an outer method.
             fn filtering_fn(ccx: @crate_ctxt,
                             m: &ty::method,
-                            outer_obj_methods: (@ast::method)[]) ->
+                            outer_obj_methods: [@ast::method]) ->
                 option::t[ty::method] {
 
                 for om: @ast::method in outer_obj_methods {
@@ -2623,7 +2623,7 @@ fn check_const(ccx: &@crate_ctxt, sp: &span, e: &@ast::expr,
     // FIXME: this is kinda a kludge; we manufacture a fake function context
     // and statement context for checking the initializer expression.
     let rty = node_id_to_type(ccx.tcx, id);
-    let fixups: ast::node_id[] = ~[];
+    let fixups: [ast::node_id] = ~[];
     let fcx: @fn_ctxt =
         @{ret_ty: rty,
           purity: ast::pure_fn,
@@ -2642,7 +2642,7 @@ fn check_fn(ccx: &@crate_ctxt, f: &ast::_fn, id: &ast::node_id,
     let decl = f.decl;
     let body = f.body;
     let gather_result = gather_locals(ccx, f, id, old_fcx);
-    let fixups: ast::node_id[] = ~[];
+    let fixups: [ast::node_id] = ~[];
     let fcx: @fn_ctxt =
         @{ret_ty: ast_ty_to_ty_crate(ccx, decl.output),
           purity: decl.purity,
@@ -2765,7 +2765,7 @@ fn check_for_main_fn(tcx: &ty::ctxt, crate: &@ast::crate) {
 fn check_crate(tcx: &ty::ctxt, crate: &@ast::crate) {
     collect::collect_item_types(tcx, crate);
 
-    let obj_infos: obj_info[] = ~[];
+    let obj_infos: [obj_info] = ~[];
 
     let ccx = @{mutable obj_infos: obj_infos, tcx: tcx};
     let visit = visit::mk_simple_visitor
index be27e9c2dec47a0fae03f4c2d769b27074542a24..8c5669aac8efbf0cb9a7acbbbf624f9fccc10d12 100644 (file)
 // FIXME: with typestate constraint, could say
 // idents and types are the same length, and are
 // non-empty
-type path_ = {global: bool, idents: ident[], types: (@ty)[]};
+type path_ = {global: bool, idents: [ident], types: [@ty]};
 
 type path = spanned[path_];
 
 fn path_name(p: &path) -> str { path_name_i(p.node.idents) }
 
-fn path_name_i(idents: &ident[]) -> str { str::connect_ivec(idents, "::") }
+fn path_name_i(idents: &[ident]) -> str { str::connect_ivec(idents, "::") }
 
 type crate_num = int;
 type node_id = int;
@@ -85,22 +85,22 @@ fn def_id_of_def(d: def) -> def_id {
 
 // The set of meta_items that define the compilation environment of the crate,
 // used to drive conditional compilation
-type crate_cfg = (@meta_item)[];
+type crate_cfg = [@meta_item];
 
 type crate = spanned[crate_];
 
 type crate_ =
-    {directives: (@crate_directive)[],
+    {directives: [@crate_directive],
      module: _mod,
-     attrs: attribute[],
+     attrs: [attribute],
      config: crate_cfg};
 
 tag crate_directive_ {
-    cdir_src_mod(ident, option::t[filename], attribute[]);
+    cdir_src_mod(ident, option::t[filename], [attribute]);
     cdir_dir_mod(ident,
                  option::t[filename],
-                 (@crate_directive)[],
-                 attribute[]);
+                 [@crate_directive],
+                 [attribute]);
     cdir_view_item(@view_item);
     cdir_syntax(path);
     cdir_auth(path, _auth);
@@ -112,13 +112,13 @@ fn def_id_of_def(d: def) -> def_id {
 
 tag meta_item_ {
     meta_word(ident);
-    meta_list(ident, (@meta_item)[]);
+    meta_list(ident, [@meta_item]);
     meta_name_value(ident, lit);
 }
 
 type blk = spanned[blk_];
 
-type blk_ = {stmts: (@stmt)[], expr: option::t[@expr], id: node_id};
+type blk_ = {stmts: [@stmt], expr: option::t[@expr], id: node_id};
 
 type pat = {id: node_id, node: pat_, span: span};
 
@@ -128,8 +128,8 @@ fn def_id_of_def(d: def) -> def_id {
     pat_wild;
     pat_bind(ident);
     pat_lit(@lit);
-    pat_tag(path, (@pat)[]);
-    pat_rec(field_pat[], bool);
+    pat_tag(path, [@pat]);
+    pat_rec([field_pat], bool);
     pat_box(@pat);
 }
 
@@ -174,7 +174,7 @@ fn walk(map: &pat_id_map, pat: &@pat) {
     }
 }
 
-fn pat_binding_ids(pat: &@pat) -> node_id[] {
+fn pat_binding_ids(pat: &@pat) -> [node_id] {
     let found = ~[];
     for each b in pat_bindings(pat) { found += ~[b.id]; }
     ret found;
@@ -275,9 +275,9 @@ fn unop_to_str(op: unop) -> str {
 
 type decl = spanned[decl_];
 
-tag decl_ { decl_local((@local)[]); decl_item(@item); }
+tag decl_ { decl_local([@local]); decl_item(@item); }
 
-type arm = {pats: (@pat)[], block: blk};
+type arm = {pats: [@pat], block: blk};
 
 type elt = {mut: mutability, expr: @expr};
 
@@ -295,12 +295,12 @@ fn unop_to_str(op: unop) -> str {
 type expr = {id: node_id, node: expr_, span: span};
 
 tag expr_ {
-    expr_vec((@expr)[], mutability, seq_kind);
-    expr_rec(field[], option::t[@expr]);
-    expr_call(@expr, (@expr)[]);
+    expr_vec([@expr], mutability, seq_kind);
+    expr_rec([field], option::t[@expr]);
+    expr_call(@expr, [@expr]);
     expr_self_method(ident);
-    expr_bind(@expr, (option::t[@expr])[]);
-    expr_spawn(spawn_dom, option::t[str], @expr, (@expr)[]);
+    expr_bind(@expr, [option::t[@expr]]);
+    expr_spawn(spawn_dom, option::t[str], @expr, [@expr]);
     expr_binary(binop, @expr, @expr);
     expr_unary(unop, @expr);
     expr_lit(@lit);
@@ -311,7 +311,7 @@ fn unop_to_str(op: unop) -> str {
     expr_for(@local, @expr, blk);
     expr_for_each(@local, @expr, blk);
     expr_do_while(blk, @expr);
-    expr_alt(@expr, arm[]);
+    expr_alt(@expr, [arm]);
     expr_fn(_fn);
     expr_block(blk);
 
@@ -392,10 +392,10 @@ fn is_path(e: &@expr) -> bool {
 type ty_method_ =
     {proto: proto,
      ident: ident,
-     inputs: ty_arg[],
+     inputs: [ty_arg],
      output: @ty,
      cf: controlflow,
-     constrs: (@constr)[]};
+     constrs: [@constr]};
 
 type ty_field = spanned[ty_field_];
 
@@ -465,12 +465,12 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
     ty_task;
     ty_port(@ty);
     ty_chan(@ty);
-    ty_rec(ty_field[]);
-    ty_fn(proto, ty_arg[], @ty, controlflow, (@constr)[]);
-    ty_obj(ty_method[]);
+    ty_rec([ty_field]);
+    ty_fn(proto, [ty_arg], @ty, controlflow, [@constr]);
+    ty_obj([ty_method]);
     ty_path(path, node_id);
     ty_type;
-    ty_constr(@ty, (@ty_constr)[]);
+    ty_constr(@ty, [@ty_constr]);
     ty_mac(mac);
 }
 
@@ -496,7 +496,7 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
 // constrained type, is * (referring to the base record)
 
 type constr_general_[ARG, ID] =
-    {path: path, args: (@spanned[constr_arg_general_[ARG]])[], id: ID};
+    {path: path, args: [@spanned[constr_arg_general_[ARG]]], id: ID};
 
 // In the front end, constraints have a node ID attached.
 // Typeck turns this to a def_id, using the output of resolve.
@@ -514,12 +514,12 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
 tag inlineness { il_normal; il_inline; }
 
 type fn_decl =
-    {inputs: arg[],
+    {inputs: [arg],
      output: @ty,
      purity: purity,
      il: inlineness,
      cf: controlflow,
-     constraints: (@constr)[]};
+     constraints: [@constr]};
 
 tag purity {
     pure_fn; // declared with "pred"
@@ -550,16 +550,16 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
 type anon_obj_field =
     {mut: mutability, ty: @ty, expr: @expr, ident: ident, id: node_id};
 
-type _obj = {fields: obj_field[], methods: (@method)[]};
+type _obj = {fields: [obj_field], methods: [@method]};
 
 type anon_obj =
     // New fields and methods, if they exist.
-    {fields: option::t[anon_obj_field[]],
-     methods: (@method)[],
+    {fields: option::t[[anon_obj_field]],
+     methods: [@method],
      // inner_obj: the original object being extended, if it exists.
      inner_obj: option::t[@expr]};
 
-type _mod = {view_items: (@view_item)[], items: (@item)[]};
+type _mod = {view_items: [@view_item], items: [@item]};
 
 tag native_abi {
     native_abi_rust;
@@ -572,21 +572,21 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
 type native_mod =
     {native_name: str,
      abi: native_abi,
-     view_items: (@view_item)[],
-     items: (@native_item)[]};
+     view_items: [@view_item],
+     items: [@native_item]};
 
 type variant_arg = {ty: @ty, id: node_id};
 
-type variant_ = {name: str, args: variant_arg[], id: node_id};
+type variant_ = {name: str, args: [variant_arg], id: node_id};
 
 type variant = spanned[variant_];
 
 type view_item = spanned[view_item_];
 
 tag view_item_ {
-    view_item_use(ident, (@meta_item)[], node_id);
-    view_item_import(ident, ident[], node_id);
-    view_item_import_glob(ident[], node_id);
+    view_item_use(ident, [@meta_item], node_id);
+    view_item_import(ident, [ident], node_id);
+    view_item_import_glob([ident], node_id);
     view_item_export(ident, node_id);
 }
 
@@ -605,32 +605,32 @@ fn ty_mach_to_str(tm: ty_mach) -> str {
 type attribute_ = {style: attr_style, value: meta_item};
 
 type item =  // For objs and resources, this is the type def_id
-    {ident: ident, attrs: attribute[], id: node_id, node: item_, span: span};
+    {ident: ident, attrs: [attribute], id: node_id, node: item_, span: span};
 
 tag item_ {
     item_const(@ty, @expr);
-    item_fn(_fn, ty_param[]);
+    item_fn(_fn, [ty_param]);
     item_mod(_mod);
     item_native_mod(native_mod);
-    item_ty(@ty, ty_param[]);
-    item_tag(variant[], ty_param[]);
-    item_obj(_obj, ty_param[], /* constructor id */node_id);
+    item_ty(@ty, [ty_param]);
+    item_tag([variant], [ty_param]);
+    item_obj(_obj, [ty_param], /* constructor id */node_id);
     item_res(_fn, /* dtor */
              node_id, /* dtor id */
-             ty_param[],
+             [ty_param],
              node_id /* ctor id */);
 }
 
 type native_item =
     {ident: ident,
-     attrs: attribute[],
+     attrs: [attribute],
      node: native_item_,
      id: node_id,
      span: span};
 
 tag native_item_ {
     native_item_ty;
-    native_item_fn(option::t[str], fn_decl, ty_param[]);
+    native_item_fn(option::t[str], fn_decl, [ty_param]);
 }
 
 fn is_exported(i: ident, m: _mod) -> bool {
index 958ebf705f5842964245f63664f8c5651888efe8..468e94255f0b7d8e378e81e11f3c52fa242e82be 100644 (file)
@@ -17,9 +17,9 @@
  * compiler.
  */
 type filemap =
-    @{name: filename, start_pos: file_pos, mutable lines: file_pos[]};
+    @{name: filename, start_pos: file_pos, mutable lines: [file_pos]};
 
-type codemap = @{mutable files: filemap[]};
+type codemap = @{mutable files: [filemap]};
 
 type loc = {filename: filename, line: uint, col: uint};
 
@@ -175,7 +175,7 @@ fn emit_note(sp: &option::t[span], msg: &str, cm: &codemap) {
     emit_diagnostic(sp, msg, "note", 10u8, cm);
 }
 
-type file_lines = {name: str, lines: uint[]};
+type file_lines = {name: str, lines: [uint]};
 
 fn span_to_lines(sp: span, cm: codemap::codemap) -> @file_lines {
     let lo = lookup_char_pos(cm, sp.lo);
index d2e6511a99382bddf5e44e09780fc464d447372e..0106f76982bf15b69a55daabc8bfd20911beb711 100644 (file)
@@ -5,7 +5,7 @@
 
 fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
                      body: option::t[str]) -> @ast::expr {
-    let args: (@ast::expr)[] = alt arg.node {
+    let args: [@ast::expr] = alt arg.node {
       ast::expr_vec(elts, _, _) { elts }
       _ { cx.span_fatal(sp, "#concat_idents requires a vector argument .") }
     };
@@ -19,4 +19,4 @@ fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
               node: {global: false, idents: ~[res], types: ~[]},
               span: sp}),
           span: sp};
-}
\ No newline at end of file
+}
index f2f4ae6a8fa99fb819b4573600814a1edf401185..2a897b570ddeb91524c307047ca057f3bd453c8a 100644 (file)
@@ -12,7 +12,7 @@
 
 fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
                      body: option::t[str]) -> @ast::expr {
-    let args: (@ast::expr)[] = alt arg.node {
+    let args: [@ast::expr] = alt arg.node {
       ast::expr_vec(elts, _, _) { elts }
       _ { cx.span_fatal(sp, "#env requires arguments of the form `[...]`.") }
     };
index 10281a9934d49ff781bb9b412feee7c44d979dc2..3df7024054a621f877760b70cddcf185790e74f8 100644 (file)
@@ -18,7 +18,7 @@
 
 fn expand_syntax_ext(cx: &ext_ctxt, sp: span, arg: @ast::expr,
                      body: option::t[str]) -> @ast::expr {
-    let args: (@ast::expr)[] = alt arg.node {
+    let args: [@ast::expr] = alt arg.node {
       ast::expr_vec(elts, _, _) { elts }
       _ { cx.span_fatal(sp, "#fmt requires arguments of the form `[...]`.") }
     };
@@ -43,7 +43,7 @@ fn parse_fmt_err_(cx: &ext_ctxt, sp: span, msg: str) -> ! {
 // be factored out in common with other code that builds expressions.
 // FIXME: Cleanup the naming of these functions
 fn pieces_to_expr(cx: &ext_ctxt, sp: span, pieces: vec[piece],
-                  args: &(@ast::expr)[]) -> @ast::expr {
+                  args: &[@ast::expr]) -> @ast::expr {
     fn make_new_lit(cx: &ext_ctxt, sp: span, lit: ast::lit_) -> @ast::expr {
         let sp_lit = @{node: lit, span: sp};
         ret @{id: cx.next_id(), node: ast::expr_lit(sp_lit), span: sp};
@@ -65,20 +65,20 @@ fn make_add_expr(cx: &ext_ctxt, sp: span, lhs: @ast::expr,
         let binexpr = ast::expr_binary(ast::add, lhs, rhs);
         ret @{id: cx.next_id(), node: binexpr, span: sp};
     }
-    fn make_path_expr(cx: &ext_ctxt, sp: span, idents: &ast::ident[]) ->
+    fn make_path_expr(cx: &ext_ctxt, sp: span, idents: &[ast::ident]) ->
        @ast::expr {
         let path = {global: false, idents: idents, types: ~[]};
         let sp_path = {node: path, span: sp};
         let pathexpr = ast::expr_path(sp_path);
         ret @{id: cx.next_id(), node: pathexpr, span: sp};
     }
-    fn make_vec_expr(cx: &ext_ctxt, sp: span, exprs: &(@ast::expr)[]) ->
+    fn make_vec_expr(cx: &ext_ctxt, sp: span, exprs: &[@ast::expr]) ->
        @ast::expr {
         let vecexpr = ast::expr_vec(exprs, ast::imm, ast::sk_rc);
         ret @{id: cx.next_id(), node: vecexpr, span: sp};
     }
-    fn make_call(cx: &ext_ctxt, sp: span, fn_path: &ast::ident[],
-                 args: &(@ast::expr)[]) -> @ast::expr {
+    fn make_call(cx: &ext_ctxt, sp: span, fn_path: &[ast::ident],
+                 args: &[@ast::expr]) -> @ast::expr {
         let pathexpr = make_path_expr(cx, sp, fn_path);
         let callexpr = ast::expr_call(pathexpr, args);
         ret @{id: cx.next_id(), node: callexpr, span: sp};
@@ -86,7 +86,7 @@ fn make_call(cx: &ext_ctxt, sp: span, fn_path: &ast::ident[],
     fn make_rec_expr(cx: &ext_ctxt, sp: span,
                      fields: vec[{ident: ast::ident, ex: @ast::expr}]) ->
        @ast::expr {
-        let astfields: ast::field[] = ~[];
+        let astfields: [ast::field] = ~[];
         for field: {ident: ast::ident, ex: @ast::expr}  in fields {
             let ident = field.ident;
             let val = field.ex;
@@ -97,7 +97,7 @@ fn make_rec_expr(cx: &ext_ctxt, sp: span,
         let recexpr = ast::expr_rec(astfields, option::none[@ast::expr]);
         ret @{id: cx.next_id(), node: recexpr, span: sp};
     }
-    fn make_path_vec(cx: &ext_ctxt, ident: str) -> str[] {
+    fn make_path_vec(cx: &ext_ctxt, ident: str) -> [str] {
         fn compiling_std(cx: &ext_ctxt) -> bool {
             ret str::find(cx.crate_file_name_hack, "std.rc") >= 0;
         }
@@ -115,7 +115,7 @@ fn make_rt_path_expr(cx: &ext_ctxt, sp: span, ident: str) -> @ast::expr {
     fn make_rt_conv_expr(cx: &ext_ctxt, sp: span, cnv: &conv) -> @ast::expr {
         fn make_flags(cx: &ext_ctxt, sp: span, flags: vec[flag]) ->
            @ast::expr {
-            let flagexprs: (@ast::expr)[] = ~[];
+            let flagexprs: [@ast::expr] = ~[];
             for f: flag  in flags {
                 let fstr;
                 alt f {
index 68a4303ec7298bc7d94db5e58d4f31731827e3d6..9399f2e8fd4ddc33fc403333400598bee038a21f 100644 (file)
@@ -5,7 +5,7 @@
 
 fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
                      body: option::t[str]) -> @ast::expr {
-    let args: (@ast::expr)[] = alt arg.node {
+    let args: [@ast::expr] = alt arg.node {
       ast::expr_vec(elts, _, _) { elts }
       _ { cx.span_fatal(sp, "#ident_to_str requires a vector argument .") }
     };
@@ -18,4 +18,4 @@ fn expand_syntax_ext(cx: &ext_ctxt, sp: codemap::span, arg: @ast::expr,
                                                 "expected an ident"),
                                   ast::sk_rc));
 
-}
\ No newline at end of file
+}
index 4e5470945440ed68fafc63736bfd3f83a6436c83..e2285aafc0bf12c121aae54a8d37a6737ac3e583 100644 (file)
@@ -93,8 +93,8 @@ fn match_error(cx: &ext_ctxt, m: &matchable, expected: &str) -> ! {
 type match_result = option::t[arb_depth[matchable]];
 type selector = fn(&matchable) -> match_result ;
 
-fn elts_to_ell(cx: &ext_ctxt, elts: &(@expr)[])
-    -> {fixed: (@expr)[], rep: option::t[@expr]} {
+fn elts_to_ell(cx: &ext_ctxt, elts: &[@expr])
+    -> {fixed: [@expr], rep: option::t[@expr]} {
     let idx: uint = 0u;
     for elt: @expr  in elts {
         alt elt.node {
@@ -153,7 +153,7 @@ fn scomp(s1: selector, s2: selector, m: &matchable) -> match_result {
 
 type binders =
     {real_binders: hashmap[ident, selector],
-     mutable literal_ast_matchers: selector[]};
+     mutable literal_ast_matchers: [selector]};
 type bindings = hashmap[ident, arb_depth[matchable]];
 
 fn acumm_bindings(cx: &ext_ctxt, b_dest: &bindings, b_src: &bindings) { }
@@ -272,8 +272,8 @@ fn mark_ident(i: &ident, fld: ast_fold, b: &bindings,
 
 /* handle sequences (anywhere in the AST) of exprs, either real or ...ed */
 fn transcribe_exprs(cx: &ext_ctxt, b: &bindings, idx_path: @mutable vec[uint],
-                    recur: fn(&@expr) -> @expr , exprs: (@expr)[])
-    -> (@expr)[] {
+                    recur: fn(&@expr) -> @expr , exprs: [@expr])
+    -> [@expr] {
     alt elts_to_ell(cx, exprs) {
       {fixed: fixed, rep: repeat_me_maybe} {
         let res = ivec::map(recur, fixed);
@@ -580,7 +580,7 @@ fn select_pt_2(m: &ast::mac) -> match_result {
 
 /* TODO: move this to vec.rs */
 
-fn ivec_to_vec[T](v: &T[]) -> vec[T] {
+fn ivec_to_vec[T](v: &[T]) -> vec[T] {
     let rs: vec[T] = vec::alloc[T](ivec::len(v));
     for ve: T  in v { rs += [ve]; }
     ret rs;
@@ -614,7 +614,7 @@ fn select(cx: &ext_ctxt, repeat_me: @expr, offset: uint, m: &matchable) ->
               compose_sels(s, bind select(cx, repeat_me, offset, _)), b);
 }
 
-fn p_t_s_r_actual_vector(cx: &ext_ctxt, elts: (@expr)[], repeat_after: bool,
+fn p_t_s_r_actual_vector(cx: &ext_ctxt, elts: [@expr], repeat_after: bool,
                          s: &selector, b: &binders) {
     fn len_select(cx: &ext_ctxt, m: &matchable, repeat_after: bool, len: uint)
         -> match_result {
@@ -662,7 +662,7 @@ fn select(cx: &ext_ctxt, m: &matchable, idx: uint) -> match_result {
 
 fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
                      body: option::t[str]) -> base::macro_def {
-    let args: (@ast::expr)[] = alt arg.node {
+    let args: [@ast::expr] = alt arg.node {
       ast::expr_vec(elts, _, _) { elts }
       _ {
         cx.span_fatal(sp, "#macro requires arguments of the form `[...]`.")
@@ -670,7 +670,7 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
     };
 
     let macro_name: option::t[str] = none;
-    let clauses: clause[] = ~[];
+    let clauses: [clause] = ~[];
     for arg: @expr  in args {
         alt arg.node {
           expr_vec(elts, mut, seq_kind) {
@@ -727,7 +727,7 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
          ext: normal(ext)};
 
     fn generic_extension(cx: &ext_ctxt, sp: span, arg: @expr,
-                         body: option::t[str], clauses: clause[]) -> @expr {
+                         body: option::t[str], clauses: [clause]) -> @expr {
         for c: clause  in clauses {
             alt use_selectors_to_bind(c.params, arg) {
               some(bindings) {
index af0673da3587b64a5516f4653cb7725ffcec91b9..d5d9898653df20a06b940cff58122438dfc6e013 100644 (file)
@@ -43,7 +43,7 @@
      fold_ident: fn(&ident, ast_fold) -> ident ,
      fold_path: fn(&path_, ast_fold) -> path_ ,
      fold_local: fn(&local_, ast_fold) -> local_ ,
-     map_exprs: fn(fn(&@expr) -> @expr , (@expr)[]) -> (@expr)[] };
+     map_exprs: fn(fn(&@expr) -> @expr , [@expr]) -> [@expr] };
 
 type a_f =
     {fold_crate: fn(&crate) -> crate ,
@@ -68,7 +68,7 @@
      fold_ident: fn(&ident) -> ident ,
      fold_path: fn(&path) -> path ,
      fold_local: fn(&@local) -> @local ,
-     map_exprs: fn(fn(&@expr) -> @expr , (@expr)[]) -> (@expr)[] };
+     map_exprs: fn(fn(&@expr) -> @expr , [@expr]) -> [@expr] };
 
 //fn nf_dummy[T](&T node) -> T { fail; }
 fn nf_crate_dummy(c: &crate) -> crate { fail; }
@@ -501,7 +501,7 @@ fn noop_fold_local(l: &local_, fld: ast_fold) -> local_ {
 
 /* temporarily eta-expand because of a compiler bug with using `fn[T]` as a
    value */
-fn noop_map_exprs(f: fn(&@expr) -> @expr , es: (@expr)[]) -> (@expr)[] {
+fn noop_map_exprs(f: fn(&@expr) -> @expr , es: [@expr]) -> [@expr] {
     ret ivec::map(f, es);
 }
 
index c5bf0f2586b978340a854c39cd847c27fdc60992..6dd06a97901aeccd88df019e769b8b0a5173247c 100644 (file)
 type ctx =
     @{p: parser,
       mode: eval_mode,
-      mutable deps: str[],
+      mutable deps: [str],
       sess: parser::parse_sess,
       mutable chpos: uint,
       mutable byte_pos: uint,
       cfg: ast::crate_cfg};
 
-fn eval_crate_directives(cx: ctx, cdirs: &(@ast::crate_directive)[],
+fn eval_crate_directives(cx: ctx, cdirs: &[@ast::crate_directive],
                          prefix: str,
-                         view_items: &mutable (@ast::view_item)[],
-                         items: &mutable (@ast::item)[]) {
+                         view_items: &mutable [@ast::view_item],
+                         items: &mutable [@ast::item]) {
     for sub_cdir: @ast::crate_directive  in cdirs {
         eval_crate_directive(cx, sub_cdir, prefix, view_items, items);
     }
 }
 
-fn eval_crate_directives_to_mod(cx: ctx, cdirs: &(@ast::crate_directive)[],
+fn eval_crate_directives_to_mod(cx: ctx, cdirs: &[@ast::crate_directive],
                                 prefix: str) -> ast::_mod {
-    let view_items: (@ast::view_item)[] = ~[];
-    let items: (@ast::item)[] = ~[];
+    let view_items: [@ast::view_item] = ~[];
+    let items: [@ast::item] = ~[];
     eval_crate_directives(cx, cdirs, prefix, view_items, items);
     ret {view_items: view_items, items: items};
 }
 
 fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
-                        view_items: &mutable (@ast::view_item)[],
-                        items: &mutable (@ast::item)[]) {
+                        view_items: &mutable [@ast::view_item],
+                        items: &mutable [@ast::item]) {
     alt cdir.node {
       ast::cdir_src_mod(id, file_opt, attrs) {
         let file_path = id + ".rs";
index bf91dfc8a9c81e547c6803225a53857ea2f4c888..40c0d8b4935459669d66450d904607c0a830928a 100644 (file)
@@ -37,7 +37,7 @@ fn new_reader(cm: &codemap::codemap, src: str, filemap: codemap::filemap,
                mutable pos: uint,
                mutable ch: char,
                mutable chpos: uint,
-               mutable strs: str[],
+               mutable strs: [str],
                fm: codemap::filemap,
                itr: @interner::interner[str]) {
         fn is_eof() -> bool { ret ch == -1 as char; }
@@ -81,7 +81,7 @@ fn err(m: str) {
             codemap::emit_error(some({lo: chpos, hi: chpos}), m, cm);
         }
     }
-    let strs: str[] = ~[];
+    let strs: [str] = ~[];
     let rd =
         reader(cm, src, str::byte_len(src), 0u, 0u, -1 as char,
                filemap.start_pos.ch, strs, filemap, itr);
@@ -550,7 +550,7 @@ fn binop(rdr: &reader, op: token::binop) -> token::token {
     blank_line; // Just a manual blank line "\n\n", for layout
 }
 
-type cmnt = {style: cmnt_style, lines: str[], pos: uint};
+type cmnt = {style: cmnt_style, lines: [str], pos: uint};
 
 fn read_to_eol(rdr: &reader) -> str {
     let val = "";
@@ -578,14 +578,14 @@ fn consume_non_eol_whitespace(rdr: &reader) {
     }
 }
 
-fn push_blank_line_comment(rdr: &reader, comments: &mutable cmnt[]) {
+fn push_blank_line_comment(rdr: &reader, comments: &mutable [cmnt]) {
     log ">>> blank-line comment";
-    let v: str[] = ~[];
+    let v: [str] = ~[];
     comments += ~[{style: blank_line, lines: v, pos: rdr.get_chpos()}];
 }
 
 fn consume_whitespace_counting_blank_lines(rdr: &reader,
-                                           comments: &mutable cmnt[]) {
+                                           comments: &mutable [cmnt]) {
     while is_whitespace(rdr.curr()) && !rdr.is_eof() {
         if rdr.get_col() == 0u && rdr.curr() == '\n' {
             push_blank_line_comment(rdr, comments);
@@ -597,7 +597,7 @@ fn consume_whitespace_counting_blank_lines(rdr: &reader,
 fn read_line_comments(rdr: &reader, code_to_the_left: bool) -> cmnt {
     log ">>> line comments";
     let p = rdr.get_chpos();
-    let lines: str[] = ~[];
+    let lines: [str] = ~[];
     while rdr.curr() == '/' && rdr.next() == '/' {
         let line = read_one_line_comment(rdr);
         log line;
@@ -619,7 +619,7 @@ fn all_whitespace(s: &str, begin: uint, end: uint) -> bool {
     ret true;
 }
 
-fn trim_whitespace_prefix_and_push_line(lines: &mutable str[], s: &str,
+fn trim_whitespace_prefix_and_push_line(lines: &mutable [str], s: &str,
                                         col: uint) {
     let s1;
     if all_whitespace(s, 0u, col) {
@@ -634,7 +634,7 @@ fn trim_whitespace_prefix_and_push_line(lines: &mutable str[], s: &str,
 fn read_block_comment(rdr: &reader, code_to_the_left: bool) -> cmnt {
     log ">>> block comment";
     let p = rdr.get_chpos();
-    let lines: str[] = ~[];
+    let lines: [str] = ~[];
     let col: uint = rdr.get_col();
     rdr.bump();
     rdr.bump();
@@ -682,7 +682,7 @@ fn peeking_at_comment(rdr: &reader) -> bool {
 }
 
 fn consume_comment(rdr: &reader, code_to_the_left: bool,
-                   comments: &mutable cmnt[]) {
+                   comments: &mutable [cmnt]) {
     log ">>> consume comment";
     if rdr.curr() == '/' && rdr.next() == '/' {
         comments += ~[read_line_comments(rdr, code_to_the_left)];
@@ -710,12 +710,12 @@ fn is_lit(t: &token::token) -> bool {
 
 fn gather_comments_and_literals(cm: &codemap::codemap, path: str,
                                 srdr: ioivec::reader) ->
-   {cmnts: cmnt[], lits: lit[]} {
+   {cmnts: [cmnt], lits: [lit]} {
     let src = str::unsafe_from_bytes_ivec(srdr.read_whole_stream());
     let itr = @interner::mk[str](str::hash, str::eq);
     let rdr = new_reader(cm, src, codemap::new_filemap(path, 0u, 0u), itr);
-    let comments: cmnt[] = ~[];
-    let literals: lit[] = ~[];
+    let comments: [cmnt] = ~[];
+    let literals: [lit] = ~[];
     let first_read: bool = true;
     while !rdr.is_eof() {
         while true {
index 7f4d5b175d33ffa691e4cd8c666efecb3d5b2133..9bcf6d5aa84ca45477e89d7fba4260da45601809 100644 (file)
@@ -47,7 +47,7 @@ fn next_node_id(sess: &parse_sess) -> node_id {
         fn get_hi_pos() -> uint ;
         fn get_last_lo_pos() -> uint ;
         fn get_last_hi_pos() -> uint ;
-        fn get_prec_table() -> @op_spec[] ;
+        fn get_prec_table() -> @[op_spec] ;
         fn get_str(token::str_num) -> str ;
         fn get_reader() -> lexer::reader ;
         fn get_filemap() -> codemap::filemap ;
@@ -79,10 +79,10 @@ fn new_parser(sess: parse_sess, cfg: ast::crate_cfg, rdr: lexer::reader,
                      mutable tok: token::token,
                      mutable tok_span: span,
                      mutable last_tok_span: span,
-                     mutable buffer: {tok: token::token, span: span}[],
+                     mutable buffer: [{tok: token::token, span: span}],
                      mutable restr: restriction,
                      rdr: lexer::reader,
-                     precs: @op_spec[],
+                     precs: @[op_spec],
                      bad_words: hashmap[str, ()]) {
         fn peek() -> token::token { ret tok; }
         fn bump() {
@@ -121,7 +121,7 @@ fn warn(m: str) {
         fn get_last_hi_pos() -> uint { ret last_tok_span.hi; }
         fn get_file_type() -> file_type { ret ftype; }
         fn get_cfg() -> ast::crate_cfg { ret cfg; }
-        fn get_prec_table() -> @op_spec[] { ret precs; }
+        fn get_prec_table() -> @[op_spec] { ret precs; }
         fn get_str(i: token::str_num) -> str {
             ret interner::get(*rdr.get_interner(), i);
         }
@@ -283,7 +283,7 @@ fn parse_fn_input_ty(p: &parser) -> ast::ty_arg {
                   parse_fn_input_ty, p);
     // FIXME: there's no syntax for this right now anyway
     //  auto constrs = parse_constrs(~[], p);
-    let constrs: (@ast::constr)[] = ~[];
+    let constrs: [@ast::constr] = ~[];
     let output: @ast::ty;
     let cf = ast::return;
     if p.peek() == token::RARROW {
@@ -354,7 +354,7 @@ fn parse_ty_field(p: &parser) -> ast::ty_field {
 
 // if i is the jth ident in args, return j
 // otherwise, fail
-fn ident_index(p: &parser, args: &ast::arg[], i: &ast::ident) -> uint {
+fn ident_index(p: &parser, args: &[ast::arg], i: &ast::ident) -> uint {
     let j = 0u;
     for a: ast::arg  in args { if a.ident == i { ret j; } j += 1u; }
     p.fatal("Unbound variable " + i + " in constraint arg");
@@ -374,7 +374,7 @@ fn parse_type_constr_arg(p: &parser) -> @ast::ty_constr_arg {
     ret @{node: carg, span: sp};
 }
 
-fn parse_constr_arg(args: &ast::arg[], p: &parser) -> @ast::constr_arg {
+fn parse_constr_arg(args: &[ast::arg], p: &parser) -> @ast::constr_arg {
     let sp = p.get_span();
     let carg = ast::carg_base;
     if p.peek() == token::BINOP(token::STAR) {
@@ -386,11 +386,11 @@ fn parse_constr_arg(args: &ast::arg[], p: &parser) -> @ast::constr_arg {
     ret @{node: carg, span: sp};
 }
 
-fn parse_ty_constr(fn_args: &ast::arg[], p: &parser) -> @ast::constr {
+fn parse_ty_constr(fn_args: &[ast::arg], p: &parser) -> @ast::constr {
     let lo = p.get_lo_pos();
     let path = parse_path(p);
     let pf = bind parse_constr_arg(fn_args, _);
-    let args: {node: (@ast::constr_arg)[], span: span} =
+    let args: {node: [@ast::constr_arg], span: span} =
         parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA), pf, p);
     ret @spanned(lo, args.span.hi,
                  {path: path, args: args.node, id: p.get_id()});
@@ -399,7 +399,7 @@ fn parse_ty_constr(fn_args: &ast::arg[], p: &parser) -> @ast::constr {
 fn parse_constr_in_type(p: &parser) -> @ast::ty_constr {
     let lo = p.get_lo_pos();
     let path = parse_path(p);
-    let args: (@ast::ty_constr_arg)[] =
+    let args: [@ast::ty_constr_arg] =
         parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
                   parse_type_constr_arg, p).node;
     let hi = p.get_lo_pos();
@@ -409,8 +409,8 @@ fn parse_constr_in_type(p: &parser) -> @ast::ty_constr {
 
 
 fn parse_constrs[T](pser: fn(&parser) -> @ast::constr_general[T] , p: &parser)
-   -> (@ast::constr_general[T])[] {
-    let constrs: (@ast::constr_general[T])[] = ~[];
+   -> [@ast::constr_general[T]] {
+    let constrs: [@ast::constr_general[T]] = ~[];
     while true {
         let constr = pser(p);
         constrs += ~[constr];
@@ -419,13 +419,14 @@ fn parse_constrs[T](pser: fn(&parser) -> @ast::constr_general[T] , p: &parser)
     constrs
 }
 
-fn parse_type_constraints(p: &parser) -> (@ast::ty_constr)[] {
+fn parse_type_constraints(p: &parser) -> [@ast::ty_constr] {
     ret parse_constrs(parse_constr_in_type, p);
 }
 
 fn parse_ty_postfix(orig_t: ast::ty_, p: &parser) -> @ast::ty {
     let lo = p.get_lo_pos();
     if p.peek() == token::LBRACKET {
+        // This is explicit type parameter instantiation.
         p.bump();
 
         let mut;
@@ -610,16 +611,16 @@ fn parse_arg(p: &parser) -> ast::arg {
 }
 
 fn parse_seq_to_end[T](ket: token::token, sep: option::t[token::token],
-                       f: fn(&parser) -> T , p: &parser) -> T[] {
+                       f: fn(&parser) -> T , p: &parser) -> [T] {
     let val = parse_seq_to_before_end(ket, sep, f, p);
     p.bump();
     ret val;
 }
 
 fn parse_seq_to_before_end[T](ket: token::token, sep: option::t[token::token],
-                              f: fn(&parser) -> T , p: &parser) -> T[] {
+                              f: fn(&parser) -> T , p: &parser) -> [T] {
     let first: bool = true;
-    let v: T[] = ~[];
+    let v: [T] = ~[];
     while p.peek() != ket {
         alt sep {
           some(t) { if first { first = false; } else { expect(p, t); } }
@@ -633,7 +634,7 @@ fn parse_seq_to_before_end[T](ket: token::token, sep: option::t[token::token],
 
 fn parse_seq[T](bra: token::token, ket: token::token,
                 sep: option::t[token::token], f: fn(&parser) -> T ,
-                p: &parser) -> spanned[T[]] {
+                p: &parser) -> spanned[[T]] {
     let lo = p.get_lo_pos();
     expect(p, bra);
     let result = parse_seq_to_before_end[T](ket, sep, f, p);
@@ -701,7 +702,7 @@ fn parse_path(p: &parser) -> ast::path {
         p.bump();
     } else { global = false; }
 
-    let ids: ast::ident[] = ~[];
+    let ids: [ast::ident] = ~[];
     while true {
         alt p.peek() {
           token::IDENT(i, _) {
@@ -865,14 +866,14 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr {
         // Anonymous object
 
         // Only make people type () if they're actually adding new fields
-        let fields: option::t[ast::anon_obj_field[]] = none;
+        let fields: option::t[[ast::anon_obj_field]] = none;
         if p.peek() == token::LPAREN {
             p.bump();
             fields =
                 some(parse_seq_to_end(token::RPAREN, some(token::COMMA),
                                       parse_anon_obj_field, p));
         }
-        let meths: (@ast::method)[] = ~[];
+        let meths: [@ast::method] = ~[];
         let inner_obj: option::t[@ast::expr] = none;
         expect(p, token::LBRACE);
         while p.peek() != token::RBRACE {
@@ -1154,7 +1155,7 @@ fn parse_ternary(p: &parser) -> @ast::expr {
 
 
 // FIXME make this a const, don't store it in parser state
-fn prec_table() -> @op_spec[] {
+fn prec_table() -> @[op_spec] {
     ret @~[{tok: token::BINOP(token::STAR), op: ast::mul, prec: 11},
            {tok: token::BINOP(token::SLASH), op: ast::div, prec: 11},
            {tok: token::BINOP(token::PERCENT), op: ast::rem, prec: 11},
@@ -1341,7 +1342,7 @@ fn parse_alt_expr(p: &parser) -> @ast::expr {
     let lo = p.get_last_lo_pos();
     let discriminant = parse_expr(p);
     expect(p, token::LBRACE);
-    let arms: ast::arm[] = ~[];
+    let arms: [ast::arm] = ~[];
     while p.peek() != token::RBRACE {
         let pats = parse_pats(p);
         let blk = parse_block(p);
@@ -1403,7 +1404,7 @@ fn parse_initializer(p: &parser) -> option::t[ast::initializer] {
     }
 }
 
-fn parse_pats(p: &parser) -> (@ast::pat)[] {
+fn parse_pats(p: &parser) -> [@ast::pat] {
     let pats = ~[];
     while true {
         pats += ~[parse_pat(p)];
@@ -1479,7 +1480,7 @@ fn parse_pat(p: &parser) -> @ast::pat {
         } else {
             let tag_path = parse_path_and_ty_param_substs(p);
             hi = tag_path.span.hi;
-            let args: (@ast::pat)[];
+            let args: [@ast::pat];
             alt p.peek() {
               token::LPAREN. {
                 let a =
@@ -1650,7 +1651,7 @@ fn parse_block(p: &parser) -> ast::blk {
 
 // some blocks start with "#{"...
 fn parse_block_tail(p: &parser, lo: uint) -> ast::blk {
-    let stmts: (@ast::stmt)[] = ~[];
+    let stmts: [@ast::stmt] = ~[];
     let expr: option::t[@ast::expr] = none;
     while p.peek() != token::RBRACE {
         alt p.peek() {
@@ -1703,8 +1704,8 @@ fn parse_ty_param(p: &parser) -> ast::ty_param {
     ret {ident: parse_ident(p), kind: k};
 }
 
-fn parse_ty_params(p: &parser) -> ast::ty_param[] {
-    let ty_params: ast::ty_param[] = ~[];
+fn parse_ty_params(p: &parser) -> [ast::ty_param] {
+    let ty_params: [ast::ty_param] = ~[];
     if p.peek() == token::LBRACKET {
         ty_params =
             parse_seq(token::LBRACKET, token::RBRACKET, some(token::COMMA),
@@ -1715,7 +1716,7 @@ fn parse_ty_params(p: &parser) -> ast::ty_param[] {
 
 fn parse_fn_decl(p: &parser, purity: ast::purity, il: ast::inlineness)
         -> ast::fn_decl {
-    let inputs: ast::spanned[ast::arg[]] =
+    let inputs: ast::spanned[[ast::arg]] =
         parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA), parse_arg,
                   p);
     let rslt: ty_or_bang;
@@ -1760,14 +1761,14 @@ fn parse_fn(p: &parser, proto: ast::proto, purity: ast::purity,
     ret {decl: decl, proto: proto, body: body};
 }
 
-fn parse_fn_header(p: &parser) -> {ident: ast::ident, tps: ast::ty_param[]} {
+fn parse_fn_header(p: &parser) -> {ident: ast::ident, tps: [ast::ty_param]} {
     let id = parse_value_ident(p);
     let ty_params = parse_ty_params(p);
     ret {ident: id, tps: ty_params};
 }
 
 fn mk_item(p: &parser, lo: uint, hi: uint, ident: &ast::ident,
-           node: &ast::item_, attrs: &ast::attribute[]) -> @ast::item {
+           node: &ast::item_, attrs: &[ast::attribute]) -> @ast::item {
     ret @{ident: ident,
           attrs: attrs,
           id: p.get_id(),
@@ -1776,7 +1777,7 @@ fn mk_item(p: &parser, lo: uint, hi: uint, ident: &ast::ident,
 }
 
 fn parse_item_fn_or_iter(p: &parser, purity: ast::purity, proto: ast::proto,
-                         attrs: &ast::attribute[], il: ast::inlineness)
+                         attrs: &[ast::attribute], il: ast::inlineness)
         -> @ast::item {
     let lo = p.get_last_lo_pos();
     let t = parse_fn_header(p);
@@ -1812,15 +1813,15 @@ fn parse_method(p: &parser) -> @ast::method {
     ret @spanned(lo, f.body.span.hi, meth);
 }
 
-fn parse_item_obj(p: &parser, attrs: &ast::attribute[]) ->
+fn parse_item_obj(p: &parser, attrs: &[ast::attribute]) ->
    @ast::item {
     let lo = p.get_last_lo_pos();
     let ident = parse_value_ident(p);
     let ty_params = parse_ty_params(p);
-    let fields: ast::spanned[ast::obj_field[]] =
+    let fields: ast::spanned[[ast::obj_field]] =
         parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
                   parse_obj_field, p);
-    let meths: (@ast::method)[] = ~[];
+    let meths: [@ast::method] = ~[];
     expect(p, token::LBRACE);
     while p.peek() != token::RBRACE {
         meths += ~[parse_method(p)];
@@ -1832,7 +1833,7 @@ fn parse_item_obj(p: &parser, attrs: &ast::attribute[]) ->
                 attrs);
 }
 
-fn parse_item_res(p: &parser, attrs: &ast::attribute[]) ->
+fn parse_item_res(p: &parser, attrs: &[ast::attribute]) ->
    @ast::item {
     let lo = p.get_last_lo_pos();
     let ident = parse_value_ident(p);
@@ -1860,11 +1861,11 @@ fn parse_item_res(p: &parser, attrs: &ast::attribute[]) ->
 }
 
 fn parse_mod_items(p: &parser, term: token::token,
-                   first_item_attrs: &ast::attribute[]) -> ast::_mod {
+                   first_item_attrs: &[ast::attribute]) -> ast::_mod {
     // Shouldn't be any view items since we've already parsed an item attr
     let view_items =
         if ivec::len(first_item_attrs) == 0u { parse_view(p) } else { ~[] };
-    let items: (@ast::item)[] = ~[];
+    let items: [@ast::item] = ~[];
     let initial_attrs = first_item_attrs;
     while p.peek() != term {
         let attrs = initial_attrs + parse_outer_attributes(p);
@@ -1880,7 +1881,7 @@ fn parse_mod_items(p: &parser, term: token::token,
     ret {view_items: view_items, items: items};
 }
 
-fn parse_item_const(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
+fn parse_item_const(p: &parser, attrs: &[ast::attribute]) -> @ast::item {
     let lo = p.get_last_lo_pos();
     let id = parse_value_ident(p);
     expect(p, token::COLON);
@@ -1892,7 +1893,7 @@ fn parse_item_const(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
     ret mk_item(p, lo, hi, id, ast::item_const(ty, e), attrs);
 }
 
-fn parse_item_mod(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
+fn parse_item_mod(p: &parser, attrs: &[ast::attribute]) -> @ast::item {
     let lo = p.get_last_lo_pos();
     let id = parse_ident(p);
     expect(p, token::LBRACE);
@@ -1904,7 +1905,7 @@ fn parse_item_mod(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
     ret mk_item(p, lo, hi, id, ast::item_mod(m), attrs + inner_attrs.inner);
 }
 
-fn parse_item_native_type(p: &parser, attrs: &ast::attribute[]) ->
+fn parse_item_native_type(p: &parser, attrs: &[ast::attribute]) ->
    @ast::native_item {
     let t = parse_type_decl(p);
     let hi = p.get_hi_pos();
@@ -1916,7 +1917,7 @@ fn parse_item_native_type(p: &parser, attrs: &ast::attribute[]) ->
           span: {lo: t.lo, hi: hi}};
 }
 
-fn parse_item_native_fn(p: &parser, attrs: &ast::attribute[]) ->
+fn parse_item_native_fn(p: &parser, attrs: &[ast::attribute]) ->
    @ast::native_item {
     let lo = p.get_last_lo_pos();
     let t = parse_fn_header(p);
@@ -1932,7 +1933,7 @@ fn parse_item_native_fn(p: &parser, attrs: &ast::attribute[]) ->
           span: {lo: lo, hi: hi}};
 }
 
-fn parse_native_item(p: &parser, attrs: &ast::attribute[]) ->
+fn parse_native_item(p: &parser, attrs: &[ast::attribute]) ->
    @ast::native_item {
     if eat_word(p, "type") {
         ret parse_item_native_type(p, attrs);
@@ -1942,14 +1943,14 @@ fn parse_native_item(p: &parser, attrs: &ast::attribute[]) ->
 }
 
 fn parse_native_mod_items(p: &parser, native_name: &str, abi: ast::native_abi,
-                          first_item_attrs: &ast::attribute[])
+                          first_item_attrs: &[ast::attribute])
     -> ast::native_mod {
     // Shouldn't be any view items since we've already parsed an item attr
     let view_items =
         if ivec::len(first_item_attrs) == 0u {
             parse_native_view(p)
         } else { ~[] };
-    let items: (@ast::native_item)[] = ~[];
+    let items: [@ast::native_item] = ~[];
     let initial_attrs = first_item_attrs;
     while p.peek() != token::RBRACE {
         let attrs = initial_attrs + parse_outer_attributes(p);
@@ -1962,7 +1963,7 @@ fn parse_native_mod_items(p: &parser, native_name: &str, abi: ast::native_abi,
          items: items};
 }
 
-fn parse_item_native_mod(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
+fn parse_item_native_mod(p: &parser, attrs: &[ast::attribute]) -> @ast::item {
     let lo = p.get_last_lo_pos();
     let abi = ast::native_abi_cdecl;
     if !is_word(p, "mod") {
@@ -2002,7 +2003,7 @@ fn parse_type_decl(p: &parser) -> {lo: uint, ident: ast::ident} {
     ret {lo: lo, ident: id};
 }
 
-fn parse_item_type(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
+fn parse_item_type(p: &parser, attrs: &[ast::attribute]) -> @ast::item {
     let t = parse_type_decl(p);
     let tps = parse_ty_params(p);
     expect(p, token::EQ);
@@ -2012,11 +2013,11 @@ fn parse_item_type(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
     ret mk_item(p, t.lo, hi, t.ident, ast::item_ty(ty, tps), attrs);
 }
 
-fn parse_item_tag(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
+fn parse_item_tag(p: &parser, attrs: &[ast::attribute]) -> @ast::item {
     let lo = p.get_last_lo_pos();
     let id = parse_ident(p);
     let ty_params = parse_ty_params(p);
-    let variants: ast::variant[] = ~[];
+    let variants: [ast::variant] = ~[];
     // Newtype syntax
     if p.peek() == token::EQ {
         if p.get_bad_expr_words().contains_key(id) {
@@ -2041,7 +2042,7 @@ fn parse_item_tag(p: &parser, attrs: &ast::attribute[]) -> @ast::item {
             check_bad_word(p);
             let vlo = p.get_lo_pos();
             p.bump();
-            let args: ast::variant_arg[] = ~[];
+            let args: [ast::variant_arg] = ~[];
             let vhi = p.get_hi_pos();
             alt p.peek() {
               token::LPAREN. {
@@ -2078,7 +2079,7 @@ fn parse_auth(p: &parser) -> ast::_auth {
     } else { unexpected(p, p.peek()); }
 }
 
-fn parse_item(p: &parser, attrs: &ast::attribute[]) -> option::t[@ast::item] {
+fn parse_item(p: &parser, attrs: &[ast::attribute]) -> option::t[@ast::item] {
     if eat_word(p, "const") {
         ret some(parse_item_const(p, attrs));
     } else if (eat_word(p, "inline")) {
@@ -2114,7 +2115,7 @@ fn parse_item(p: &parser, attrs: &ast::attribute[]) -> option::t[@ast::item] {
 
 // A type to distingush between the parsing of item attributes or syntax
 // extensions, which both begin with token.POUND
-type attr_or_ext = option::t[either::t[ast::attribute[], @ast::expr]];
+type attr_or_ext = option::t[either::t[[ast::attribute], @ast::expr]];
 
 fn parse_outer_attrs_or_ext(p: &parser) -> attr_or_ext {
     if p.peek() == token::POUND {
@@ -2130,8 +2131,8 @@ fn parse_outer_attrs_or_ext(p: &parser) -> attr_or_ext {
 }
 
 // Parse attributes that appear before an item
-fn parse_outer_attributes(p: &parser) -> ast::attribute[] {
-    let attrs: ast::attribute[] = ~[];
+fn parse_outer_attributes(p: &parser) -> [ast::attribute] {
+    let attrs: [ast::attribute] = ~[];
     while p.peek() == token::POUND {
         attrs += ~[parse_attribute(p, ast::attr_outer)];
     }
@@ -2160,9 +2161,9 @@ fn parse_attribute_naked(p: &parser, style: ast::attr_style, lo: uint) ->
 // of the containing item or an outer attribute of the first contained item
 // until we see the semi).
 fn parse_inner_attrs_and_next(p: &parser) ->
-   {inner: ast::attribute[], next: ast::attribute[]} {
-    let inner_attrs: ast::attribute[] = ~[];
-    let next_outer_attrs: ast::attribute[] = ~[];
+   {inner: [ast::attribute], next: [ast::attribute]} {
+    let inner_attrs: [ast::attribute] = ~[];
+    let next_outer_attrs: [ast::attribute] = ~[];
     while p.peek() == token::POUND {
         let attr = parse_attribute(p, ast::attr_inner);
         if p.peek() == token::SEMI {
@@ -2202,12 +2203,12 @@ fn parse_meta_item(p: &parser) -> @ast::meta_item {
     }
 }
 
-fn parse_meta_seq(p: &parser) -> (@ast::meta_item)[] {
+fn parse_meta_seq(p: &parser) -> [@ast::meta_item] {
     ret parse_seq(token::LPAREN, token::RPAREN, some(token::COMMA),
                   parse_meta_item, p).node;
 }
 
-fn parse_optional_meta(p: &parser) -> (@ast::meta_item)[] {
+fn parse_optional_meta(p: &parser) -> [@ast::meta_item] {
     alt p.peek() { token::LPAREN. { ret parse_meta_seq(p); } _ { ret ~[]; } }
 }
 
@@ -2220,7 +2221,7 @@ fn parse_use(p: &parser) -> ast::view_item_ {
 fn parse_rest_import_name(p: &parser, first: ast::ident,
                           def_ident: option::t[ast::ident]) ->
    ast::view_item_ {
-    let identifiers: ast::ident[] = ~[first];
+    let identifiers: [ast::ident] = ~[first];
     let glob: bool = false;
     while true {
         alt p.peek() {
@@ -2315,14 +2316,14 @@ fn is_view_item(p: &parser) -> bool {
     }
 }
 
-fn parse_view(p: &parser) -> (@ast::view_item)[] {
-    let items: (@ast::view_item)[] = ~[];
+fn parse_view(p: &parser) -> [@ast::view_item] {
+    let items: [@ast::view_item] = ~[];
     while is_view_item(p) { items += ~[parse_view_item(p)]; }
     ret items;
 }
 
-fn parse_native_view(p: &parser) -> (@ast::view_item)[] {
-    let items: (@ast::view_item)[] = ~[];
+fn parse_native_view(p: &parser) -> [@ast::view_item] {
+    let items: [@ast::view_item] = ~[];
     while is_view_item(p) { items += ~[parse_view_item(p)]; }
     ret items;
 }
@@ -2370,7 +2371,7 @@ fn parse_str(p: &parser) -> ast::ident {
 // Each crate file is a sequence of directives.
 //
 // Each directive imperatively extends its environment with 0 or more items.
-fn parse_crate_directive(p: &parser, first_outer_attr: &ast::attribute[]) ->
+fn parse_crate_directive(p: &parser, first_outer_attr: &[ast::attribute]) ->
    ast::crate_directive {
 
     // Collect the next attributes
@@ -2425,8 +2426,8 @@ fn parse_crate_directive(p: &parser, first_outer_attr: &ast::attribute[]) ->
 }
 
 fn parse_crate_directives(p: &parser, term: token::token,
-                          first_outer_attr: &ast::attribute[]) ->
-   (@ast::crate_directive)[] {
+                          first_outer_attr: &[ast::attribute]) ->
+   [@ast::crate_directive] {
 
     // This is pretty ugly. If we have an outer attribute then we can't accept
     // seeing the terminator next, so if we do see it then fail the same way
@@ -2435,7 +2436,7 @@ fn parse_crate_directives(p: &parser, term: token::token,
         expect_word(p, "mod");
     }
 
-    let cdirs: (@ast::crate_directive)[] = ~[];
+    let cdirs: [@ast::crate_directive] = ~[];
     while p.peek() != term {
         let cdir = @parse_crate_directive(p, first_outer_attr);
         cdirs += ~[cdir];
@@ -2452,7 +2453,7 @@ fn parse_crate_from_crate_file(input: &str, cfg: &ast::crate_cfg,
     let crate_attrs = leading_attrs.inner;
     let first_cdir_attr = leading_attrs.next;
     let cdirs = parse_crate_directives(p, token::EOF, first_cdir_attr);
-    let deps: str[] = ~[];
+    let deps: [str] = ~[];
     let cx =
         @{p: p,
           mode: eval::mode_parse,
index b1f84782952ea65e740c74e6608d4ff72ad7d75a..00b6c5f32bff44ccf331db4eb17e06b05082ccd2 100644 (file)
@@ -74,7 +74,7 @@ fn tok_str(t: token) -> str {
     }
 }
 
-fn buf_str(toks: &token[mutable ], szs: &int[mutable ], left: uint,
+fn buf_str(toks: &[mutable token], szs: &[mutable int], left: uint,
            right: uint, lim: uint) -> str {
     let n = ivec::len(toks);
     assert (n == ivec::len(szs));
@@ -104,10 +104,10 @@ fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
 
     let n: uint = 3u * linewidth;
     log #fmt("mk_printer %u", linewidth);
-    let token: token[mutable ] = ivec::init_elt_mut(EOF, n);
-    let size: int[mutable ] = ivec::init_elt_mut(0, n);
-    let scan_stack: uint[mutable ] = ivec::init_elt_mut(0u, n);
-    let print_stack: print_stack_elt[] = ~[];
+    let token: [mutable token] = ivec::init_elt_mut(EOF, n);
+    let size: [mutable int] = ivec::init_elt_mut(0, n);
+    let scan_stack: [mutable uint] = ivec::init_elt_mut(0u, n);
+    let print_stack: [print_stack_elt] = ~[];
     ret printer(out, n, linewidth as int, // margin
                 linewidth as int, // space
                 0u, // left
@@ -208,10 +208,10 @@ fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
 
             mutable right: uint, // index of right side of input stream
 
-            mutable token: token[mutable ],
+            mutable token: [mutable token],
 
             // ring-buffr stream goes through
-            mutable size: int[mutable ], // ring-buffer of calculated sizes
+            mutable size: [mutable int], // ring-buffer of calculated sizes
 
             mutable left_total: int, // running size of stream "...left"
 
@@ -223,7 +223,7 @@ fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
              // BEGIN (if there is any) on top of it. Stuff is flushed off the
              // bottom as it becomes irrelevant due to the primary ring-buffer
              // advancing.
-             mutable scan_stack: uint[mutable ],
+             mutable scan_stack: [mutable uint],
             mutable scan_stack_empty: bool, // top==bottom disambiguator
 
             mutable top: uint, // index of top of scan_stack
@@ -231,7 +231,7 @@ fn mk_printer(out: ioivec::writer, linewidth: uint) -> printer {
             mutable bottom: uint, // index of bottom of scan_stack
 
              // stack of blocks-in-progress being flushed by print
-            mutable print_stack: print_stack_elt[],
+            mutable print_stack: [print_stack_elt],
 
 
             // buffered indentation to avoid writing trailing whitespace
index 1b34cd4830440e3e415c845dda187746fb802d40..c732039eaa14905bd7a66ae7d5c6b5b541e3691a 100644 (file)
@@ -41,11 +41,11 @@ fn ignore(node: &ann_node) { }
 type ps =
     @{s: pp::printer,
       cm: option::t[codemap],
-      comments: option::t[lexer::cmnt[]],
-      literals: option::t[lexer::lit[]],
+      comments: option::t[[lexer::cmnt]],
+      literals: option::t[[lexer::lit]],
       mutable cur_cmnt: uint,
       mutable cur_lit: uint,
-      mutable boxes: pp::breaks[],
+      mutable boxes: [pp::breaks],
       ann: pp_ann};
 
 fn ibox(s: &ps, u: uint) { s.boxes += ~[pp::inconsistent]; pp::ibox(s.s, u); }
@@ -53,11 +53,11 @@ fn ignore(node: &ann_node) { }
 fn end(s: &ps) { ivec::pop(s.boxes); pp::end(s.s); }
 
 fn rust_printer(writer: ioivec::writer) -> ps {
-    let boxes: pp::breaks[] = ~[];
+    let boxes: [pp::breaks] = ~[];
     ret @{s: pp::mk_printer(writer, default_columns),
           cm: none[codemap],
-          comments: none[lexer::cmnt[]],
-          literals: none[lexer::lit[]],
+          comments: none[[lexer::cmnt]],
+          literals: none[[lexer::lit]],
           mutable cur_cmnt: 0u,
           mutable cur_lit: 0u,
           mutable boxes: boxes,
@@ -74,7 +74,7 @@ fn rust_printer(writer: ioivec::writer) -> ps {
 // copy forward.
 fn print_crate(cm: &codemap, crate: @ast::crate, filename: str,
                in: ioivec::reader, out: ioivec::writer, ann: &pp_ann) {
-    let boxes: pp::breaks[] = ~[];
+    let boxes: [pp::breaks] = ~[];
     let r = lexer::gather_comments_and_literals(cm, filename, in);
     let s =
         @{s: pp::mk_printer(out, default_columns),
@@ -102,7 +102,7 @@ fn print_crate(cm: &codemap, crate: @ast::crate, filename: str,
 
 fn path_to_str(p: &ast::path) -> str { be to_str(p, print_path); }
 
-fn fun_to_str(f: &ast::_fn, name: str, params: &ast::ty_param[]) -> str {
+fn fun_to_str(f: &ast::_fn, name: str, params: &[ast::ty_param]) -> str {
     let writer = ioivec::string_writer();
     let s = rust_printer(writer.get_writer());
     print_fn(s, f.decl, f.proto, name, params, f.decl.constraints);
@@ -216,7 +216,7 @@ fn synth_comment(s: &ps, text: str) {
     word(s.s, "*/");
 }
 
-fn commasep[IN](s: &ps, b: breaks, elts: &IN[], op: fn(&ps, &IN) ) {
+fn commasep[IN](s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ) {
     box(s, 0u, b);
     let first = true;
     for elt: IN  in elts {
@@ -227,7 +227,7 @@ fn commasep[IN](s: &ps, b: breaks, elts: &IN[], op: fn(&ps, &IN) ) {
 }
 
 
-fn commasep_cmnt[IN](s: &ps, b: breaks, elts: &IN[], op: fn(&ps, &IN) ,
+fn commasep_cmnt[IN](s: &ps, b: breaks, elts: &[IN], op: fn(&ps, &IN) ,
                      get_span: fn(&IN) -> codemap::span ) {
     box(s, 0u, b);
     let len = ivec::len[IN](elts);
@@ -246,12 +246,12 @@ fn commasep_cmnt[IN](s: &ps, b: breaks, elts: &IN[], op: fn(&ps, &IN) ,
     end(s);
 }
 
-fn commasep_exprs(s: &ps, b: breaks, exprs: &(@ast::expr)[]) {
+fn commasep_exprs(s: &ps, b: breaks, exprs: &[@ast::expr]) {
     fn expr_span(expr: &@ast::expr) -> codemap::span { ret expr.span; }
     commasep_cmnt(s, b, exprs, print_expr, expr_span);
 }
 
-fn print_mod(s: &ps, _mod: &ast::_mod, attrs: &ast::attribute[]) {
+fn print_mod(s: &ps, _mod: &ast::_mod, attrs: &[ast::attribute]) {
     print_inner_attributes(s, attrs);
     for vitem: @ast::view_item  in _mod.view_items {
         print_view_item(s, vitem);
@@ -260,7 +260,7 @@ fn print_mod(s: &ps, _mod: &ast::_mod, attrs: &ast::attribute[]) {
 }
 
 fn print_native_mod(s: &ps, nmod: &ast::native_mod,
-                    attrs: &ast::attribute[]) {
+                    attrs: &[ast::attribute]) {
     print_inner_attributes(s, attrs);
     for vitem: @ast::view_item  in nmod.view_items {
         print_view_item(s, vitem);
@@ -505,7 +505,7 @@ fn print_field(s: &ps, field: &ast::obj_field) {
         space(s.s);
         bopen(s);
         for meth: @ast::method  in _obj.methods {
-            let typarams: ast::ty_param[] = ~[];
+            let typarams: [ast::ty_param] = ~[];
             hardbreak_if_not_bol(s);
             maybe_print_comment(s, meth.span.lo);
             print_fn(s, meth.node.meth.decl, meth.node.meth.proto,
@@ -530,7 +530,7 @@ fn print_field(s: &ps, field: &ast::obj_field) {
     s.ann.post(ann_node);
 }
 
-fn print_outer_attributes(s: &ps, attrs: &ast::attribute[]) {
+fn print_outer_attributes(s: &ps, attrs: &[ast::attribute]) {
     let count = 0;
     for attr: ast::attribute  in attrs {
         alt attr.node.style {
@@ -541,7 +541,7 @@ fn print_outer_attributes(s: &ps, attrs: &ast::attribute[]) {
     if count > 0 { hardbreak_if_not_bol(s); }
 }
 
-fn print_inner_attributes(s: &ps, attrs: &ast::attribute[]) {
+fn print_inner_attributes(s: &ps, attrs: &[ast::attribute]) {
     let count = 0;
     for attr: ast::attribute  in attrs {
         alt attr.node.style {
@@ -1011,7 +1011,7 @@ fn get_span(f: &ast::anon_obj_field) -> codemap::span {
 
         // Methods
         for meth: @ast::method in anon_obj.methods {
-            let typarams: ast::ty_param[] = ~[];
+            let typarams: [ast::ty_param] = ~[];
             hardbreak_if_not_bol(s);
             maybe_print_comment(s, meth.span.lo);
             print_fn(s, meth.node.meth.decl, meth.node.meth.proto,
@@ -1145,7 +1145,7 @@ fn print_field(s: &ps, f: &ast::field_pat) {
 }
 
 fn print_fn(s: &ps, decl: ast::fn_decl, proto: ast::proto, name: str,
-            typarams: &ast::ty_param[], constrs: (@ast::constr)[]) {
+            typarams: &[ast::ty_param], constrs: [@ast::constr]) {
     alt decl.purity {
       ast::impure_fn. { head(s, proto_to_str(proto)); }
       _ { head(s, "pred"); }
@@ -1156,7 +1156,7 @@ fn print_fn(s: &ps, decl: ast::fn_decl, proto: ast::proto, name: str,
 }
 
 fn print_fn_args_and_ret(s: &ps, decl: &ast::fn_decl,
-                        constrs: (@ast::constr)[]) {
+                        constrs: [@ast::constr]) {
     popen(s);
     fn print_arg(s: &ps, x: &ast::arg) {
         ibox(s, indent_unit);
@@ -1193,7 +1193,7 @@ fn print_kind(s: &ps, kind: ast::kind) {
     }
 }
 
-fn print_type_params(s: &ps, params: &ast::ty_param[]) {
+fn print_type_params(s: &ps, params: &[ast::ty_param]) {
     if ivec::len(params) > 0u {
         word(s.s, "[");
         fn printParam(s: &ps, param: &ast::ty_param) {
@@ -1308,8 +1308,8 @@ fn print_mt(s: &ps, mt: &ast::mt) {
 }
 
 fn print_ty_fn(s: &ps, proto: &ast::proto, id: &option::t[str],
-               inputs: &ast::ty_arg[], output: &@ast::ty,
-               cf: &ast::controlflow, constrs: &(@ast::constr)[]) {
+               inputs: &[ast::ty_arg], output: &@ast::ty,
+               cf: &ast::controlflow, constrs: &[@ast::constr]) {
     ibox(s, indent_unit);
     word(s.s, proto_to_str(proto));
     alt id { some(id) { word(s.s, " "); word(s.s, id); } _ { } }
@@ -1518,7 +1518,7 @@ fn next_comment(s: &ps) -> option::t[lexer::cmnt] {
 // Removing the aliases from the type of f in the next two functions
 // triggers memory corruption, but I haven't isolated the bug yet. FIXME
 fn constr_args_to_str[T](f: &fn(&T) -> str ,
-                         args: &(@ast::sp_constr_arg[T])[]) -> str {
+                         args: &[@ast::sp_constr_arg[T]]) -> str {
     let comma = false;
     let s = "(";
     for a: @ast::sp_constr_arg[T]  in args {
@@ -1549,7 +1549,7 @@ fn ast_ty_fn_constr_to_str(c: &@ast::constr) -> str {
 }
 
 // FIXME: fix repeated code
-fn ast_ty_fn_constrs_str(constrs: &(@ast::constr)[]) -> str {
+fn ast_ty_fn_constrs_str(constrs: &[@ast::constr]) -> str {
     let s = "";
     let colon = true;
     for c: @ast::constr  in constrs {
@@ -1571,7 +1571,7 @@ fn ast_fn_constr_to_str(decl: &ast::fn_decl, c: &@ast::constr) -> str {
 
 // FIXME: fix repeated code
 fn ast_fn_constrs_str(decl: &ast::fn_decl,
-                      constrs: &(@ast::constr)[]) -> str {
+                      constrs: &[@ast::constr]) -> str {
     let s = "";
     let colon = true;
     for c: @ast::constr  in constrs {
@@ -1596,7 +1596,7 @@ fn ty_constr_to_str(c: &@ast::ty_constr) -> str {
 }
 
 
-fn ast_ty_constrs_str(constrs: &(@ast::ty_constr)[]) -> str {
+fn ast_ty_constrs_str(constrs: &[@ast::ty_constr]) -> str {
     let s = "";
     let colon = true;
     for c: @ast::ty_constr  in constrs {
index 7e7a9ca71073233969ac821525d5997ea59f4d74..7f95d0ef0e7173f0ba11800da6193e838ea0ecee 100644 (file)
@@ -12,7 +12,7 @@
 
 type interner[T] =
     {map: hashmap[T, uint],
-     mutable vect: T[],
+     mutable vect: [T],
      hasher: hashfn[T],
      eqer: eqfn[T]};
 
index 673fa46d466cd85a13c1b85561a8ae2aabfb6efe..9c639b8c5c008edc1f4386f55822e2c3febf37f9 100644 (file)
@@ -33,7 +33,7 @@
       visit_ty: fn(&@ty, &E, &vt[E]) ,
       visit_constr: fn(&path, &span, node_id, &E, &vt[E]) ,
       visit_fn:
-          fn(&_fn, &ty_param[], &span, &fn_ident, node_id, &E, &vt[E]) };
+          fn(&_fn, &[ty_param], &span, &fn_ident, node_id, &E, &vt[E]) };
 
 fn default_visitor[E]() -> visitor[E] {
     ret @{visit_mod: bind visit_mod[E](_, _, _, _),
@@ -195,7 +195,7 @@ fn visit_fn_decl[E](fd: &fn_decl, e: &E, v: &vt[E]) {
     v.visit_ty(fd.output, e, v);
 }
 
-fn visit_fn[E](f: &_fn, tp: &ty_param[], sp: &span, i: &fn_ident, id: node_id,
+fn visit_fn[E](f: &_fn, tp: &[ty_param], sp: &span, i: &fn_ident, id: node_id,
                e: &E, v: &vt[E]) {
     visit_fn_decl(f.decl, e, v);
     v.visit_block(f.body, e, v);
@@ -227,7 +227,7 @@ fn visit_expr_opt[E](eo: option::t[@expr], e: &E, v: &vt[E]) {
     alt eo { none. { } some(ex) { v.visit_expr(ex, e, v); } }
 }
 
-fn visit_exprs[E](exprs: &(@expr)[], e: &E, v: &vt[E]) {
+fn visit_exprs[E](exprs: &[@expr], e: &E, v: &vt[E]) {
     for ex: @expr  in exprs { v.visit_expr(ex, e, v); }
 }
 
@@ -362,7 +362,7 @@ fn visit_arm[E](a: &arm, e: &E, v: &vt[E]) {
       visit_expr: fn(&@expr) ,
       visit_ty: fn(&@ty) ,
       visit_constr: fn(&path, &span, node_id) ,
-      visit_fn: fn(&_fn, &ty_param[], &span, &fn_ident, node_id) };
+      visit_fn: fn(&_fn, &[ty_param], &span, &fn_ident, node_id) };
 
 fn default_simple_visitor() -> simple_visitor {
     ret @{visit_mod: fn (m: &_mod, sp: &span) { },
@@ -379,7 +379,7 @@ fn default_simple_visitor() -> simple_visitor {
           visit_ty: fn (t: &@ty) { },
           visit_constr: fn (p: &path, sp: &span, id: node_id) { },
           visit_fn:
-              fn (f: &_fn, tps: &ty_param[], sp: &span, ident: &fn_ident,
+              fn (f: &_fn, tps: &[ty_param], sp: &span, ident: &fn_ident,
                   id: node_id) {
               }};
 }
@@ -439,8 +439,8 @@ fn v_constr(f: fn(&path, &span, node_id) , pt: &path, sp: &span,
         f(pt, sp, id);
         visit_constr(pt, sp, id, e, v);
     }
-    fn v_fn(f: fn(&_fn, &ty_param[], &span, &fn_ident, node_id) , ff: &_fn,
-            tps: &ty_param[], sp: &span, ident: &fn_ident, id: node_id,
+    fn v_fn(f: fn(&_fn, &[ty_param], &span, &fn_ident, node_id) , ff: &_fn,
+            tps: &[ty_param], sp: &span, ident: &fn_ident, id: node_id,
             e: &(), v: &vt[()]) {
         f(ff, tps, sp, ident, id);
         visit_fn(ff, tps, sp, ident, id, e, v);
index aed835aedec5976782c69e7ed3ec6235abd26f69..e0e9a5bfa52d431a922235f60124e1f24422a6ee 100644 (file)
@@ -49,7 +49,7 @@ fn new_def_hash[@V]() -> std::map::hashmap[ast::def_id, V] {
 
 fn elt_expr(e: &ast::elt) -> @ast::expr { ret e.expr; }
 
-fn elt_exprs(elts: &ast::elt[]) -> (@ast::expr)[] {
+fn elt_exprs(elts: &[ast::elt]) -> [@ast::expr] {
     let es = ~[];
     for e: ast::elt  in elts { es += ~[e.expr]; }
     ret es;
@@ -57,7 +57,7 @@ fn elt_exprs(elts: &ast::elt[]) -> (@ast::expr)[] {
 
 fn field_expr(f: &ast::field) -> @ast::expr { ret f.node.expr; }
 
-fn field_exprs(fields: &ast::field[]) -> (@ast::expr)[] {
+fn field_exprs(fields: &[ast::field]) -> [@ast::expr] {
     let es = ~[];
     for f: ast::field  in fields { es += ~[f.node.expr]; }
     ret es;
@@ -77,11 +77,11 @@ fn field_exprs(fields: &ast::field[]) -> (@ast::expr)[] {
 
 fn log_item_err(i: &@ast::item) { log_err print::pprust::item_to_str(i); }
 
-fn log_fn(f: &ast::_fn, name: str, params: &ast::ty_param[]) {
+fn log_fn(f: &ast::_fn, name: str, params: &[ast::ty_param]) {
     log print::pprust::fun_to_str(f, name, params);
 }
 
-fn log_fn_err(f: &ast::_fn, name: str, params: &ast::ty_param[]) {
+fn log_fn_err(f: &ast::_fn, name: str, params: &[ast::ty_param]) {
     log_err print::pprust::fun_to_str(f, name, params);
 }
 
@@ -161,7 +161,7 @@ fn call_kind_str(c: call_kind) -> str {
     }
 }
 
-fn is_main_name(path: &str[]) -> bool {
+fn is_main_name(path: &[str]) -> bool {
     str::eq(option::get(std::ivec::last(path)), "main")
 }
 
index 93530b26f35352b5cf10c8c8015eae2283ddfbd9..63d84d363e4f2f37cde351119fc1f5f812af4ff5 100644 (file)
@@ -42,8 +42,8 @@ fn fn_input_to_str(cx: &ctxt, input: &{mode: middle::ty::mode, ty: t}) ->
         ret s + ty_to_str(cx, input.ty);
     }
     fn fn_to_str(cx: &ctxt, proto: ast::proto, ident: option::t[ast::ident],
-                 inputs: &arg[], output: t, cf: ast::controlflow,
-                 constrs: &(@constr)[]) -> str {
+                 inputs: &[arg], output: t, cf: ast::controlflow,
+                 constrs: &[@constr]) -> str {
         let s = proto_to_str(proto);
         alt ident { some(i) { s += " "; s += i; } _ { } }
         s += "(";
@@ -98,7 +98,7 @@ fn mt_to_str(cx: &ctxt, m: &mt) -> str {
       ty_type. { s += "type"; }
       ty_task. { s += "task"; }
       ty_rec(elems) {
-        let strs: str[] = ~[];
+        let strs: [str] = ~[];
         for fld: field  in elems { strs += ~[field_to_str(cx, fld)]; }
         s += "{" + str::connect_ivec(strs, ",") + "}";
       }
@@ -107,7 +107,7 @@ fn mt_to_str(cx: &ctxt, m: &mt) -> str {
 
         s += "<tag#" + int::str(id.crate) + ":" + int::str(id.node) + ">";
         if ivec::len[t](tps) > 0u {
-            let strs: str[] = ~[];
+            let strs: [str] = ~[];
             for typ: t  in tps { strs += ~[ty_to_str(cx, typ)]; }
             s += "[" + str::connect_ivec(strs, ",") + "]";
         }
@@ -149,7 +149,7 @@ fn constr_to_str(c: &@constr) -> str {
             pprust::constr_args_to_str(pprust::uint_to_str, c.node.args);
 }
 
-fn constrs_str(constrs: &(@constr)[]) -> str {
+fn constrs_str(constrs: &[@constr]) -> str {
     let s = "";
     let colon = true;
     for c: @constr  in constrs {