Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

The wonky for...in... whitespace was bothering me. Sorry!

  • Loading branch information...
commit f91351aaf69b0d4fefaff0df1c288466c0183de5 1 parent cb239cc
@lkuper lkuper authored
Showing with 565 additions and 565 deletions.
  1. +3 −3 src/comp/back/link.rs
  2. +1 −1  src/comp/back/upcall.rs
  3. +5 −5 src/comp/driver/rustc.rs
  4. +6 −6 src/comp/front/attr.rs
  5. +1 −1  src/comp/front/config.rs
  6. +1 −1  src/comp/front/test.rs
  7. +2 −2 src/comp/lib/llvm.rs
  8. +1 −1  src/comp/metadata/common.rs
  9. +4 −4 src/comp/metadata/creader.rs
  10. +9 −9 src/comp/metadata/decoder.rs
  11. +17 −17 src/comp/metadata/encoder.rs
  12. +2 −2 src/comp/metadata/tydecode.rs
  13. +9 −9 src/comp/metadata/tyencode.rs
  14. +19 −19 src/comp/middle/alias.rs
  15. +2 −2 src/comp/middle/ast_map.rs
  16. +6 −6 src/comp/middle/check_alt.rs
  17. +3 −3 src/comp/middle/freevars.rs
  18. +20 −20 src/comp/middle/resolve.rs
  19. +61 −61 src/comp/middle/trans.rs
  20. +17 −17 src/comp/middle/trans_alt.rs
  21. +2 −2 src/comp/middle/trans_comm.rs
  22. +1 −1  src/comp/middle/trans_common.rs
  23. +4 −4 src/comp/middle/trans_dps.rs
  24. +10 −10 src/comp/middle/trans_objects.rs
  25. +1 −1  src/comp/middle/tstate/annotate.rs
  26. +23 −23 src/comp/middle/tstate/auxiliary.rs
  27. +1 −1  src/comp/middle/tstate/bitvectors.rs
  28. +1 −1  src/comp/middle/tstate/ck.rs
  29. +3 −3 src/comp/middle/tstate/collect_locals.rs
  30. +9 −9 src/comp/middle/tstate/pre_post_conditions.rs
  31. +3 −3 src/comp/middle/tstate/states.rs
  32. +47 −47 src/comp/middle/ty.rs
  33. +40 −40 src/comp/middle/typeck.rs
  34. +3 −3 src/comp/syntax/ast.rs
  35. +3 −3 src/comp/syntax/codemap.rs
  36. +5 −5 src/comp/syntax/ext/fmt.rs
  37. +8 −8 src/comp/syntax/ext/simplext.rs
  38. +1 −1  src/comp/syntax/fold.rs
  39. +1 −1  src/comp/syntax/parse/eval.rs
  40. +1 −1  src/comp/syntax/parse/lexer.rs
  41. +3 −3 src/comp/syntax/parse/parser.rs
  42. +24 −24 src/comp/syntax/print/pprust.rs
  43. +31 −31 src/comp/syntax/visit.rs
  44. +1 −1  src/comp/util/common.rs
  45. +5 −5 src/comp/util/ppaux.rs
  46. +10 −10 src/fuzzer/ivec_fuzz.rs
  47. +8 −8 src/lib/bitv.rs
  48. +3 −3 src/lib/either.rs
  49. +1 −1  src/lib/extfmt.rs
  50. +1 −1  src/lib/fs.rs
  51. +2 −2 src/lib/getopts.rs
  52. +2 −2 src/lib/io.rs
  53. +9 −9 src/lib/ivec.rs
  54. +1 −1  src/lib/list.rs
  55. +3 −3 src/lib/map.rs
  56. +1 −1  src/lib/run_program.rs
  57. +3 −3 src/lib/sha1.rs
  58. +9 −9 src/lib/str.rs
  59. +1 −1  src/lib/term.rs
  60. +1 −1  src/lib/test.rs
  61. +2 −2 src/test/bench/99bob-iter.rs
  62. +4 −4 src/test/bench/shootout-fasta.rs
  63. +2 −2 src/test/bench/shootout-nbody.rs
  64. +4 −4 src/test/bench/shootout-pfib.rs
  65. +1 −1  src/test/bench/task-perf-word-count.rs
  66. +2 −2 src/test/compile-fail/for-loop-decl.rs
  67. +2 −2 src/test/compile-fail/shadow.rs
  68. +2 −2 src/test/compile-fail/unsafe-for.rs
  69. +1 −1  src/test/compiletest/compiletest.rs
  70. +2 −2 src/test/compiletest/header.rs
  71. +2 −2 src/test/compiletest/runtest.rs
  72. +1 −1  src/test/run-fail/for-each-loop-fail.rs
  73. +2 −2 src/test/run-pass/alt-phi.rs
  74. +2 −2 src/test/run-pass/argv.rs
  75. +2 −2 src/test/run-pass/auto-loop.rs
  76. +1 −1  src/test/run-pass/block-iter-1.rs
  77. +1 −1  src/test/run-pass/block-iter-2.rs
  78. +3 −3 src/test/run-pass/break.rs
  79. +1 −1  src/test/run-pass/for-loop-fail.rs
  80. +2 −2 src/test/run-pass/foreach-box-drop.rs
  81. +4 −4 src/test/run-pass/foreach-nested-2.rs
  82. +3 −3 src/test/run-pass/foreach-nested.rs
  83. +2 −2 src/test/run-pass/foreach-put-structured.rs
  84. +2 −2 src/test/run-pass/foreach-simple-outer-slot.rs
  85. +2 −2 src/test/run-pass/foreach-simple.rs
  86. +2 −2 src/test/run-pass/generic-iter-frame.rs
  87. +2 −2 src/test/run-pass/hashmap-memory.rs
  88. +2 −2 src/test/run-pass/iter-range.rs
  89. +2 −2 src/test/run-pass/iter-ret.rs
  90. +3 −3 src/test/run-pass/linear-for-loop.rs
  91. +2 −2 src/test/run-pass/loop-scope.rs
  92. +2 −2 src/test/run-pass/maybe-mutable.rs
  93. +2 −2 src/test/run-pass/move-3.rs
  94. +2 −2 src/test/run-pass/pattern-bound-var-in-for-each.rs
  95. +7 −7 src/test/run-pass/rt-circular-buffer.rs
  96. +2 −2 src/test/run-pass/task-comm.rs
  97. +2 −2 src/test/run-pass/type-params-in-for-each.rs
  98. +2 −2 src/test/run-pass/utf8.rs
  99. +1 −1  src/test/stdtest/qsort.rs
  100. +2 −2 src/test/stdtest/sha1.rs
  101. +1 −1  src/test/stdtest/str.rs
  102. +2 −2 src/test/stdtest/test.rs
View
6 src/comp/back/link.rs
@@ -296,7 +296,7 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
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 {
+ for meta: @ast::meta_item in linkage_metas {
if attr::get_meta_item_name(meta) == "name" {
alt attr::get_meta_item_value_str(meta) {
some(v) { name = some(v); }
@@ -326,7 +326,7 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &str,
let cmh_items = attr::sort_meta_items(metas.cmh_items);
sha.reset();
- for m_: @ast::meta_item in cmh_items {
+ for m_: @ast::meta_item in cmh_items {
let m = m_;
alt m.node {
ast::meta_name_value(key, value) {
@@ -429,7 +429,7 @@ fn mangle(ss: &[str]) -> str {
let n = "_ZN"; // Begin name-sequence.
- for s: str in ss { n += #fmt("%u%s", str::byte_len(s), s); }
+ for s: str in ss { n += #fmt("%u%s", str::byte_len(s), s); }
n += "E"; // End name-sequence.
ret n;
View
2  src/comp/back/upcall.rs
@@ -68,7 +68,7 @@ fn declare_upcalls(tn: type_names, tydesc_type: TypeRef,
fn decl(tn: type_names, llmod: ModuleRef, name: str, tys: [TypeRef],
rv: TypeRef) -> ValueRef {
let arg_tys: [TypeRef] = ~[];
- for t: TypeRef in tys { arg_tys += ~[t]; }
+ 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);
}
View
10 src/comp/driver/rustc.rs
@@ -82,7 +82,7 @@ fn parse_cfgspecs(cfgspecs: &[str]) -> ast::crate_cfg {
// FIXME: It would be nice to use the parser to parse all varieties of
// meta_item here. At the moment we just support the meta_word variant.
let words = ~[];
- for s: str in cfgspecs { words += ~[attr::mk_word_item(s)]; }
+ for s: str in cfgspecs { words += ~[attr::mk_word_item(s)]; }
ret words;
}
@@ -334,7 +334,7 @@ fn build_session_options(binary: str, match: getopts::match, binary_dir: str)
let library_search_paths = ~[binary_dir + "/lib"];
let lsp_vec = getopts::opt_strs(match, "L");
- for lsp: str in lsp_vec { library_search_paths += ~[lsp]; }
+ for lsp: str in lsp_vec { library_search_paths += ~[lsp]; }
let parse_only = opt_present(match, "parse-only");
let no_trans = opt_present(match, "no-trans");
@@ -591,7 +591,7 @@ fn main(args: vec[str]) {
}
let cstore = sess.get_cstore();
- for cratepath: str in cstore::get_used_crate_files(cstore) {
+ for cratepath: str in cstore::get_used_crate_files(cstore) {
if str::ends_with(cratepath, ".rlib") {
gcc_args += ~[cratepath];
cont;
@@ -603,10 +603,10 @@ fn main(args: vec[str]) {
}
let ula = cstore::get_used_link_args(cstore);
- for arg: str in ula { gcc_args += ~[arg]; }
+ for arg: str in ula { gcc_args += ~[arg]; }
let used_libs = cstore::get_used_libraries(cstore);
- for l: str in used_libs { gcc_args += ~["-l" + l]; }
+ for l: str in used_libs { gcc_args += ~["-l" + l]; }
if sopts.library {
gcc_args += ~[lib_cmd];
View
12 src/comp/front/attr.rs
@@ -31,7 +31,7 @@ export mk_attr;
// linkage
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") {
+ for attr: ast::attribute in find_attrs_by_name(attrs, "link") {
alt attr.node.value.node {
ast::meta_list(_, items) { metas += items; }
_ { log "ignoring link attribute that has incorrect type"; }
@@ -96,7 +96,7 @@ 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] {
let mitems = ~[];
- for a: ast::attribute in attrs { mitems += ~[attr_meta(a)]; }
+ for a: ast::attribute in attrs { mitems += ~[attr_meta(a)]; }
ret mitems;
}
@@ -124,7 +124,7 @@ fn eq(a: @ast::meta_item, b: @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 {
+ for item: @ast::meta_item in haystack {
log #fmt("looking in %s",
syntax::print::pprust::meta_item_to_str(*item));
if eq(item, needle) { log "found it!"; ret true; }
@@ -153,12 +153,12 @@ fn sort_meta_items(items: &[@ast::meta_item]) -> [@ast::meta_item] {
// This is sort of stupid here, converting to a vec of mutables and back
let v: [mutable @ast::meta_item] = ~[mutable];
- for mi: @ast::meta_item in items { v += ~[mutable mi]; }
+ for mi: @ast::meta_item in items { v += ~[mutable mi]; }
std::sort::quick_sort(lteq, v);
let v2: [@ast::meta_item] = ~[];
- for mi: @ast::meta_item in v { v2 += ~[mi]; }
+ for mi: @ast::meta_item in v { v2 += ~[mi]; }
ret v2;
}
@@ -179,7 +179,7 @@ fn remove_meta_items_by_name(items: &[@ast::meta_item], name: str) ->
fn require_unique_names(sess: &session::session,
metas: &[@ast::meta_item]) {
let map = map::mk_hashmap[str, ()](str::hash, str::eq);
- for meta: @ast::meta_item in metas {
+ for meta: @ast::meta_item in metas {
let name = get_meta_item_name(meta);
if map.contains_key(name) {
sess.span_fatal(meta.span,
View
2  src/comp/front/config.rs
@@ -118,7 +118,7 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &[ast::attribute]) -> bool {
ivec::foldl(extract_metas, ~[], cfg_metas)
};
- for cfg_mi: @ast::meta_item in item_cfg_metas {
+ for cfg_mi: @ast::meta_item in item_cfg_metas {
if attr::contains(cfg, cfg_mi) { ret true; }
}
View
2  src/comp/front/test.rs
@@ -229,7 +229,7 @@ fn mk_test_desc_ivec_ty(cx: &test_ctxt) -> @ast::ty {
fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
log #fmt("building test vector from %u tests", ivec::len(cx.testfns));
let descs = ~[];
- for test: test in cx.testfns {
+ for test: test in cx.testfns {
let test_ = test; // Satisfy alias analysis
descs += ~[mk_test_desc_rec(cx, test_)];
}
View
4 src/comp/lib/llvm.rs
@@ -1469,7 +1469,7 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
fn tys_str(names: type_names, outer: &[TypeRef], tys: &[TypeRef]) -> str {
let s: str = "";
let first: bool = true;
- for t: TypeRef in tys {
+ for t: TypeRef in tys {
if first { first = false; } else { s += ", "; }
s += type_to_str_inner(names, outer, t);
}
@@ -1531,7 +1531,7 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
11 {
let i: uint = 0u;
- for tout: TypeRef in outer0 {
+ for tout: TypeRef in outer0 {
i += 1u;
if tout as int == ty as int {
let n: uint = ivec::len[TypeRef](outer0) - i;
View
2  src/comp/metadata/common.rs
@@ -69,7 +69,7 @@ fn hash_node_id(node_id: &int) -> uint { ret 177573u ^ (node_id as uint); }
fn hash_path(s: &str) -> uint {
let h = 5381u;
- for ch: u8 in str::bytes(s) { h = (h << 5u) + h ^ (ch as uint); }
+ for ch: u8 in str::bytes(s) { h = (h << 5u) + h ^ (ch as uint); }
ret h;
}
View
8 src/comp/metadata/creader.rs
@@ -96,7 +96,7 @@ fn metadata_matches(crate_data: &@[u8], metas: &[@ast::meta_item]) -> bool {
log #fmt("matching %u metadata requirements against %u items",
ivec::len(metas), ivec::len(linkage_metas));
- for needed: @ast::meta_item in metas {
+ for needed: @ast::meta_item in metas {
if !attr::contains(linkage_metas, needed) {
log #fmt("missing %s", pprust::meta_item_to_str(*needed));
ret false;
@@ -156,9 +156,9 @@ fn find_library_crate_aux(nn: &{prefix: str, suffix: str}, crate_name: str,
// stomach from here, and writing a C++ wrapper is more work than just
// manually filtering fs::list_dir here.
- for library_search_path: str in library_search_paths {
+ for library_search_path: str in library_search_paths {
log #fmt("searching %s", library_search_path);
- for path: str in fs::list_dir(library_search_path) {
+ for path: str in fs::list_dir(library_search_path) {
log #fmt("searching %s", path);
let f: str = fs::basename(path);
if !(str::starts_with(f, prefix) && str::ends_with(f, nn.suffix))
@@ -250,7 +250,7 @@ fn resolve_crate_deps(e: env, cdata: &@[u8]) -> cstore::cnum_map {
// The map from crate numbers in the crate we're resolving to local crate
// numbers
let cnum_map = new_int_hash[ast::crate_num]();
- for dep: decoder::crate_dep in decoder::get_crate_deps(cdata) {
+ for dep: decoder::crate_dep in decoder::get_crate_deps(cdata) {
let extrn_cnum = dep.cnum;
let cname = dep.ident;
log #fmt("resolving dep %s", cname);
View
18 src/comp/metadata/decoder.rs
@@ -46,7 +46,7 @@ fn lookup_hash(d: &ebml::doc, eq_fn: fn(&[u8]) -> bool , hash: uint) ->
let result: [ebml::doc] = ~[];
let belt = tag_index_buckets_bucket_elt;
- for each elt: ebml::doc in ebml::tagged_docs(bucket, belt) {
+ for each elt: ebml::doc in ebml::tagged_docs(bucket, belt) {
let pos = ebml::be_uint_from_bytes(elt.data, elt.start, 4u);
if eq_fn(ivec::slice[u8](*elt.data, elt.start + 4u, elt.end)) {
result += ~[ebml::doc_at(d.data, pos)];
@@ -138,7 +138,7 @@ fn tag_variant_ids(item: &ebml::doc, this_cnum: ast::crate_num) ->
[ast::def_id] {
let ids: [ast::def_id] = ~[];
let v = tag_items_data_item_variant;
- for each p: ebml::doc in ebml::tagged_docs(item, v) {
+ for each p: ebml::doc in ebml::tagged_docs(item, v) {
let ext = parse_def_id(ebml::doc_data(p));
ids += ~[{crate: this_cnum, node: ext.node}];
}
@@ -156,7 +156,7 @@ fn resolve_path(path: &[ast::ident], data: @[u8]) -> [ast::def_id] {
let paths = ebml::get_doc(md, tag_paths);
let eqer = bind eq_item(_, s);
let result: [ast::def_id] = ~[];
- for doc: ebml::doc in lookup_hash(paths, eqer, hash_path(s)) {
+ for doc: ebml::doc in lookup_hash(paths, eqer, hash_path(s)) {
let did_doc = ebml::get_doc(doc, tag_def_id);
result += ~[parse_def_id(ebml::doc_data(did_doc))];
}
@@ -233,13 +233,13 @@ fn get_tag_variants(data: &@[u8], def: ast::def_id, tcx: &ty::ctxt,
let item = find_item(def.node, items);
let infos: [ty::variant_info] = ~[];
let variant_ids = tag_variant_ids(item, external_crate_id);
- for did: ast::def_id in variant_ids {
+ 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] = ~[];
alt ty::struct(tcx, ctor_ty) {
ty::ty_fn(_, args, _, _, _) {
- for a: ty::arg in args { arg_tys += ~[a.ty]; }
+ for a: ty::arg in args { arg_tys += ~[a.ty]; }
}
_ {
// Nullary tag variant.
@@ -344,7 +344,7 @@ fn get_attributes(md: &ebml::doc) -> [ast::attribute] {
}
fn list_meta_items(meta_items: &ebml::doc, out: io::writer) {
- for mi: @ast::meta_item in get_meta_items(meta_items) {
+ for mi: @ast::meta_item in get_meta_items(meta_items) {
out.write_str(#fmt("%s\n", pprust::meta_item_to_str(*mi)));
}
}
@@ -352,7 +352,7 @@ fn list_meta_items(meta_items: &ebml::doc, out: io::writer) {
fn list_crate_attributes(md: &ebml::doc, out: io::writer) {
out.write_str("=Crate Attributes=\n");
- for attr: ast::attribute in get_attributes(md) {
+ for attr: ast::attribute in get_attributes(md) {
out.write_str(#fmt("%s\n", pprust::attribute_to_str(attr)));
}
@@ -382,7 +382,7 @@ fn get_crate_deps(data: @[u8]) -> [crate_dep] {
fn list_crate_deps(data: @[u8], out: io::writer) {
out.write_str("=External Dependencies=\n");
- for dep: crate_dep in get_crate_deps(data) {
+ for dep: crate_dep in get_crate_deps(data) {
out.write_str(#fmt("%d %s\n", dep.cnum, dep.ident));
}
@@ -398,7 +398,7 @@ fn list_crate_items(bytes: &@[u8], md: &ebml::doc, out: io::writer) {
for each bucket: ebml::doc in
ebml::tagged_docs(bs, tag_index_buckets_bucket) {
let et = tag_index_buckets_bucket_elt;
- for each elt: ebml::doc in ebml::tagged_docs(bucket, et) {
+ for each elt: ebml::doc in ebml::tagged_docs(bucket, et) {
let data = read_path(elt);
let def = ebml::doc_at(bytes, data.pos);
let did_doc = ebml::get_doc(def, tag_def_id);
View
34 src/comp/metadata/encoder.rs
@@ -40,7 +40,7 @@ type entry[T] = {val: T, pos: uint};
fn encode_tag_variant_paths(ebml_w: &ebml::writer, variants: &[variant],
path: &[str], index: &mutable [entry[str]]) {
- for variant: variant in variants {
+ for variant: variant in variants {
add_to_index(ebml_w, path, index, variant.node.name);
ebml::start_tag(ebml_w, tag_paths_data_item);
encode_name(ebml_w, variant.node.name);
@@ -60,7 +60,7 @@ fn add_to_index(ebml_w: &ebml::writer, path: &[str],
fn encode_native_module_item_paths(ebml_w: &ebml::writer,
nmod: &native_mod, path: &[str],
index: &mutable [entry[str]]) {
- for nitem: @native_item in nmod.items {
+ for nitem: @native_item in nmod.items {
add_to_index(ebml_w, path, index, nitem.ident);
ebml::start_tag(ebml_w, tag_paths_data_item);
encode_name(ebml_w, nitem.ident);
@@ -71,7 +71,7 @@ fn encode_native_module_item_paths(ebml_w: &ebml::writer,
fn encode_module_item_paths(ebml_w: &ebml::writer, module: &_mod,
path: &[str], index: &mutable [entry[str]]) {
- for it: @item in module.items {
+ for it: @item in module.items {
if !is_exported(it.ident, module) { cont; }
alt it.node {
item_const(_, _) {
@@ -228,7 +228,7 @@ fn encode_tag_variant_info(ecx: &@encode_ctxt, ebml_w: &ebml::writer,
id: node_id, variants: &[variant],
index: &mutable [entry[int]],
ty_params: &[ty_param]) {
- for variant: variant in variants {
+ for variant: variant in variants {
index += ~[{val: variant.node.id, pos: ebml_w.writer.tell()}];
ebml::start_tag(ebml_w, tag_items_data_item);
encode_def_id(ebml_w, local_def(variant.node.id));
@@ -298,7 +298,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: &ebml::writer,
encode_family(ebml_w, 't' as u8);
encode_type_param_kinds(ebml_w, tps);
encode_type(ecx, ebml_w, node_id_to_monotype(ecx.ccx.tcx, item.id));
- for v: variant in variants {
+ for v: variant in variants {
encode_variant_id(ebml_w, local_def(v.node.id));
}
ebml::end_tag(ebml_w);
@@ -395,14 +395,14 @@ fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebml::writer) ->
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 {
+ for each i: uint in uint::range(0u, 256u) { buckets += ~[@mutable ~[]]; }
+ for elt: entry[T] in index {
let h = hash_fn(elt.val);
*buckets.(h % 256u) += ~[elt];
}
let buckets_frozen = ~[];
- for bucket: @mutable [entry[T]] in buckets {
+ for bucket: @mutable [entry[T]] in buckets {
buckets_frozen += ~[@*bucket];
}
ret buckets_frozen;
@@ -414,10 +414,10 @@ fn encode_index[T](ebml_w: &ebml::writer, buckets: &[@[entry[T]]],
ebml::start_tag(ebml_w, tag_index);
let bucket_locs: [uint] = ~[];
ebml::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()];
ebml::start_tag(ebml_w, tag_index_buckets_bucket);
- for elt: entry[T] in *bucket {
+ for elt: entry[T] in *bucket {
ebml::start_tag(ebml_w, tag_index_buckets_bucket_elt);
writer.write_be_uint(elt.pos, 4u);
write_fn(writer, elt.val);
@@ -427,7 +427,7 @@ fn encode_index[T](ebml_w: &ebml::writer, buckets: &[@[entry[T]]],
}
ebml::end_tag(ebml_w);
ebml::start_tag(ebml_w, tag_index_table);
- for pos: uint in bucket_locs { writer.write_be_uint(pos, 4u); }
+ for pos: uint in bucket_locs { writer.write_be_uint(pos, 4u); }
ebml::end_tag(ebml_w);
ebml::end_tag(ebml_w);
}
@@ -467,7 +467,7 @@ fn encode_meta_item(ebml_w: &ebml::writer, mi: &meta_item) {
ebml::start_tag(ebml_w, tag_meta_item_name);
ebml_w.writer.write(str::bytes(name));
ebml::end_tag(ebml_w);
- for inner_item: @meta_item in items {
+ for inner_item: @meta_item in items {
encode_meta_item(ebml_w, *inner_item);
}
ebml::end_tag(ebml_w);
@@ -477,7 +477,7 @@ fn encode_meta_item(ebml_w: &ebml::writer, mi: &meta_item) {
fn encode_attributes(ebml_w: &ebml::writer, attrs: &[attribute]) {
ebml::start_tag(ebml_w, tag_attributes);
- for attr: attribute in attrs {
+ for attr: attribute in attrs {
ebml::start_tag(ebml_w, tag_attribute);
encode_meta_item(ebml_w, attr.node.value);
ebml::end_tag(ebml_w);
@@ -516,7 +516,7 @@ fn synthesize_crate_attrs(ecx: &@encode_ctxt, crate: &@crate) -> [attribute] {
let attrs: [attribute] = ~[];
let found_link_attr = false;
- for attr: attribute in crate.node.attrs {
+ for attr: attribute in crate.node.attrs {
attrs +=
if attr::get_attr_name(attr) != "link" {
~[attr]
@@ -544,7 +544,7 @@ fn encode_crate_deps(ebml_w: &ebml::writer, cstore: &cstore::cstore) {
// Pull the cnums and names out of cstore
let pairs: [mutable numname] = ~[mutable];
- for each hashkv: hashkv in cstore::iter_crate_data(cstore) {
+ for each hashkv: hashkv in cstore::iter_crate_data(cstore) {
pairs += ~[mutable {crate: hashkv.key, ident: hashkv.val.name}];
}
@@ -556,7 +556,7 @@ fn encode_crate_deps(ebml_w: &ebml::writer, cstore: &cstore::cstore) {
// Sanity-check the crate numbers
let expected_cnum = 1;
- for n: numname in pairs {
+ for n: numname in pairs {
assert (n.crate == expected_cnum);
expected_cnum += 1;
}
@@ -573,7 +573,7 @@ fn encode_crate_deps(ebml_w: &ebml::writer, cstore: &cstore::cstore) {
// FIXME: This is not nearly enough to support correct versioning
// but is enough to get transitive crate dependencies working.
ebml::start_tag(ebml_w, tag_crate_deps);
- for cname: str in get_ordered_names(cstore) {
+ for cname: str in get_ordered_names(cstore) {
ebml::start_tag(ebml_w, tag_crate_dep);
ebml_w.writer.write(str::bytes(cname));
ebml::end_tag(ebml_w);
View
4 src/comp/metadata/tydecode.rs
@@ -420,8 +420,8 @@ fn parse_def_id(buf: &[u8]) -> ast::def_id {
let crate_part_vec = ~[];
let def_part_vec = ~[];
- for b: u8 in crate_part { crate_part_vec += ~[b]; }
- for b: u8 in def_part { def_part_vec += ~[b]; }
+ for b: u8 in crate_part { crate_part_vec += ~[b]; }
+ for b: u8 in def_part { def_part_vec += ~[b]; }
let crate_num = uint::parse_buf(crate_part_vec, 10u) as int;
let def_num = uint::parse_buf(def_part_vec, 10u) as int;
View
18 src/comp/metadata/tyencode.rs
@@ -117,7 +117,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
w.write_str("t[");
w.write_str(cx.ds(def));
w.write_char('|');
- for t: ty::t in tys { enc_ty(w, cx, t); }
+ for t: ty::t in tys { enc_ty(w, cx, t); }
w.write_char(']');
}
ty::ty_tup(ts) {
@@ -134,7 +134,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
ty::ty_chan(t) { w.write_char('C'); enc_ty(w, cx, t); }
ty::ty_rec(fields) {
w.write_str("R[");
- for field: ty::field in fields {
+ for field: ty::field in fields {
w.write_str(field.ident);
w.write_char('=');
enc_mt(w, cx, field.mt);
@@ -158,7 +158,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
}
ty::ty_obj(methods) {
w.write_str("O[");
- for m: ty::method in methods {
+ for m: ty::method in methods {
enc_proto(w, m.proto);
w.write_str(m.ident);
enc_ty_fn(w, cx, m.inputs, m.output, m.cf, m.constrs);
@@ -170,7 +170,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
w.write_str(cx.ds(def));
w.write_char('|');
enc_ty(w, cx, ty);
- for t: ty::t in tps { enc_ty(w, cx, t); }
+ for t: ty::t in tps { enc_ty(w, cx, t); }
w.write_char(']');
}
ty::ty_var(id) { w.write_char('X'); w.write_str(int::str(id)); }
@@ -192,7 +192,7 @@ fn enc_sty(w: &io::writer, cx: &@ctxt, st: &ty::sty) {
ty::ty_constr(ty, cs) {
w.write_str("A[");
enc_ty(w, cx, ty);
- for tc: @ty::type_constr in cs { enc_ty_constr(w, cx, tc); }
+ for tc: @ty::type_constr in cs { enc_ty_constr(w, cx, tc); }
w.write_char(']');
}
}
@@ -208,7 +208,7 @@ fn enc_proto(w: &io::writer, proto: proto) {
fn enc_ty_fn(w: &io::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
cf: &controlflow, constrs: &[@ty::constr]) {
w.write_char('[');
- for arg: ty::arg in args {
+ for arg: ty::arg in args {
alt arg.mode {
ty::mo_alias(mut) {
w.write_char('&');
@@ -223,7 +223,7 @@ fn enc_ty_fn(w: &io::writer, cx: &@ctxt, args: &[ty::arg], out: &ty::t,
}
w.write_char(']');
let colon = true;
- for c: @ty::constr in constrs {
+ for c: @ty::constr in constrs {
if colon {
w.write_char(':');
colon = false;
@@ -241,7 +241,7 @@ fn enc_constr(w: &io::writer, cx: &@ctxt, c: &@ty::constr) {
w.write_str(cx.ds(c.node.id));
w.write_char('|');
let semi = false;
- for a: @constr_arg in c.node.args {
+ for a: @constr_arg in c.node.args {
if semi { w.write_char(';'); } else { semi = true; }
alt a.node {
carg_base. { w.write_char('*'); }
@@ -258,7 +258,7 @@ fn enc_ty_constr(w: &io::writer, cx: &@ctxt, c: &@ty::type_constr) {
w.write_str(cx.ds(c.node.id));
w.write_char('|');
let semi = false;
- for a: @ty::ty_constr_arg in c.node.args {
+ for a: @ty::ty_constr_arg in c.node.args {
if semi { w.write_char(';'); } else { semi = true; }
alt a.node {
carg_base. { w.write_char('*'); }
View
38 src/comp/middle/alias.rs
@@ -54,7 +54,7 @@ fn check_crate(tcx: ty::ctxt, crate: &@ast::crate) {
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 {
+ for arg_: ast::arg in f.decl.inputs {
cx.local_map.insert(arg_.id, arg(arg_.mode));
}
let scope = alt (f.proto) {
@@ -85,7 +85,7 @@ fn visit_fn(cx: &@ctx, f: &ast::_fn, tp: &[ast::ty_param], sp: &span,
fn visit_item(cx: &@ctx, i: &@ast::item, sc: &scope, v: &vt[scope]) {
alt i.node {
ast::item_obj(o, _, _) {
- for f: ast::obj_field in o.fields {
+ for f: ast::obj_field in o.fields {
cx.local_map.insert(f.id, objfield(f.mut));
}
}
@@ -173,7 +173,7 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
let unsafe_ts: [ty::t] = ~[];
let unsafe_t_offsets: [uint] = ~[];
let i = 0u;
- for arg_t: ty::arg in arg_ts {
+ for arg_t: ty::arg in arg_ts {
if arg_t.mode != ty::mo_val {
let arg = args.(i);
let root = expr_root(cx, arg, false);
@@ -232,11 +232,11 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
}
}
let j = 0u;
- for unsafe: ty::t in unsafe_ts {
+ for unsafe: ty::t in unsafe_ts {
let offset = unsafe_t_offsets.(j);
j += 1u;
let i = 0u;
- for arg_t: ty::arg in arg_ts {
+ for arg_t: ty::arg in arg_ts {
let mut_alias = arg_t.mode == ty::mo_alias(true);
if i != offset &&
ty_can_unsafely_include(cx, unsafe, arg_t.ty, mut_alias) {
@@ -250,10 +250,10 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
}
// Ensure we're not passing a root by mutable alias.
- for root: {arg: uint, node: node_id} in mut_roots {
+ for root: {arg: uint, node: node_id} in mut_roots {
let mut_alias_to_root = false;
let mut_alias_to_root_count = 0u;
- for r: node_id in roots {
+ for r: node_id in roots {
if root.node == r {
mut_alias_to_root_count += 1u;
if mut_alias_to_root_count > 1u {
@@ -277,7 +277,7 @@ fn check_tail_call(cx: &ctx, call: &@ast::expr) {
let args;
let f = alt call.node { ast::expr_call(f, args_) { args = args_; f } };
let i = 0u;
- for arg_t: ty::arg in fty_args(cx, ty::expr_ty(cx.tcx, f)) {
+ for arg_t: ty::arg in fty_args(cx, ty::expr_ty(cx.tcx, f)) {
if arg_t.mode != ty::mo_val {
let mut_a = arg_t.mode == ty::mo_alias(true);
let ok = true;
@@ -316,7 +316,7 @@ fn check_alt(cx: &ctx, input: &@ast::expr, arms: &[ast::arm], sc: &scope,
alt path_def_id(cx, root.ex) { some(did) { ~[did.node] } _ { ~[] } };
let forbidden_tp: [ty::t] =
alt inner_mut(root.ds) { some(t) { ~[t] } _ { ~[] } };
- for a: ast::arm in arms {
+ for a: ast::arm in arms {
let dnums = arm_defnums(a);
let new_sc = sc;
if ivec::len(dnums) > 0u {
@@ -390,7 +390,7 @@ fn check_var(cx: &ctx, ex: &@ast::expr, p: &ast::path, id: ast::node_id,
if !def_is_local(def, true) { ret; }
let my_defnum = ast::def_id_of_def(def).node;
let var_t = ty::expr_ty(cx.tcx, ex);
- for r: restrict in *sc {
+ for r: restrict in *sc {
// excludes variables introduced since the alias was made
// FIXME This does not work anymore, now that we have macros.
if my_defnum < r.block_defnum {
@@ -475,7 +475,7 @@ fn is_immutable_alias(cx: &ctx, sc: &scope, dnum: node_id) -> bool {
some(arg(ast::alias(false))) { ret true; }
_ { }
}
- for r: restrict in *sc {
+ for r: restrict in *sc {
if ivec::member(dnum, r.bindings) { ret true; }
}
ret false;
@@ -487,7 +487,7 @@ fn is_immutable_objfield(cx: &ctx, dnum: node_id) -> bool {
fn test_scope(cx: &ctx, sc: &scope, r: &restrict, p: &ast::path) {
let prob = r.ok;
- for dep: uint in r.depends_on {
+ for dep: uint in r.depends_on {
if prob != valid { break; }
prob = sc.(dep).ok;
}
@@ -509,8 +509,8 @@ fn test_scope(cx: &ctx, sc: &scope, r: &restrict, p: &ast::path) {
fn deps(sc: &scope, roots: &[node_id]) -> [uint] {
let i = 0u;
let result = ~[];
- for r: restrict in *sc {
- for dn: node_id in roots {
+ for r: restrict in *sc {
+ for dn: node_id in roots {
if ivec::member(dn, r.bindings) { result += ~[i]; }
}
i += 1u;
@@ -568,7 +568,7 @@ fn expr_root(cx: &ctx, ex: @ast::expr, autoderef: bool) ->
let mut = false;
alt ty::struct(cx.tcx, auto_unbox.t) {
ty::ty_rec(fields) {
- for fld: ty::field in fields {
+ for fld: ty::field in fields {
if str::eq(ident, fld.ident) {
mut = fld.mt.mut != ast::imm;
break;
@@ -626,12 +626,12 @@ fn expr_root(cx: &ctx, ex: @ast::expr, autoderef: bool) ->
}
fn mut_field(ds: &@[deref]) -> bool {
- for d: deref in *ds { if d.mut { ret true; } }
+ for d: deref in *ds { if d.mut { ret true; } }
ret false;
}
fn inner_mut(ds: &@[deref]) -> option::t[ty::t] {
- for d: deref in *ds { if d.mut { ret some(d.outer_t); } }
+ for d: deref in *ds { if d.mut { ret some(d.outer_t); } }
ret none;
}
@@ -661,7 +661,7 @@ fn ty_can_unsafely_include(cx: &ctx, needle: ty::t, haystack: ty::t,
if needle == haystack { ret true; }
alt ty::struct(tcx, haystack) {
ty::ty_tag(_, ts) {
- for t: ty::t in ts {
+ for t: ty::t in ts {
if helper(tcx, needle, t, mut) { ret true; }
}
ret false;
@@ -671,7 +671,7 @@ fn ty_can_unsafely_include(cx: &ctx, needle: ty::t, haystack: ty::t,
}
ty::ty_uniq(t) { ret helper(tcx, needle, t, false); }
ty::ty_rec(fields) {
- for f: ty::field in fields {
+ for f: ty::field in fields {
if helper(tcx, needle, f.mt.ty, get_mut(mut, f.mt)) {
ret true;
}
View
4 src/comp/middle/ast_map.rs
@@ -93,7 +93,7 @@ fn new_smallintmap_adapter[@K,
iter items() -> @{key: K, val: V} {
let idx = 0u;
- for item: option::t[V] in map.v {
+ for item: option::t[V] in map.v {
alt item {
option::some(elt) {
let value = elt;
@@ -106,7 +106,7 @@ fn new_smallintmap_adapter[@K,
}
}
iter keys() -> K {
- for each p: @{key: K, val: V} in self.items() { put p.key; }
+ for each p: @{key: K, val: V} in self.items() { put p.key; }
}
}
View
12 src/comp/middle/check_alt.rs
@@ -17,12 +17,12 @@ fn check_expr(tcx: &ty::ctxt, ex: &@expr, s: &(), v: &visit::vt[()]) {
fn check_arms(tcx: &ty::ctxt, arms: &[arm]) {
let i = 0;
- for arm: arm in arms {
- for arm_pat: @pat in arm.pats {
+ for arm: arm in arms {
+ for arm_pat: @pat in arm.pats {
let reachable = true;
let j = 0;
while j < i {
- for prev_pat: @pat in arms.(j).pats {
+ for prev_pat: @pat in arms.(j).pats {
if pattern_supersedes(tcx, prev_pat, arm_pat) {
reachable = false;
}
@@ -41,7 +41,7 @@ fn pattern_supersedes(tcx: &ty::ctxt, a: &@pat, b: &@pat) -> bool {
fn patterns_supersede(tcx: &ty::ctxt, as: &[@pat], bs: &[@pat]) ->
bool {
let i = 0;
- for a: @pat in as {
+ for a: @pat in as {
if !pattern_supersedes(tcx, a, bs.(i)) { ret false; }
i += 1;
}
@@ -50,9 +50,9 @@ fn pattern_supersedes(tcx: &ty::ctxt, a: &@pat, b: &@pat) -> bool {
fn field_patterns_supersede(tcx: &ty::ctxt, fas: &[field_pat],
fbs: &[field_pat]) -> bool {
let wild = @{id: 0, node: pat_wild, span: dummy_sp()};
- for fa: field_pat in fas {
+ for fa: field_pat in fas {
let pb = wild;
- for fb: field_pat in fbs {
+ for fb: field_pat in fbs {
if fa.ident == fb.ident { pb = fb.pat; }
}
if !pattern_supersedes(tcx, fa.pat, pb) { ret false; }
View
6 src/comp/middle/freevars.rs
@@ -42,12 +42,12 @@ fn collect_freevars(def_map: &resolve::def_map, sess: &session::session,
walker: &fn(&visit::vt[()]) ,
initial_decls: [ast::node_id]) -> freevar_info {
let decls = new_int_hash();
- for decl: ast::node_id in initial_decls { set_add(decls, decl); }
+ 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,
i: &ast::fn_ident, nid: ast::node_id) {
- for a: ast::arg in f.decl.inputs { set_add(decls, a.id); }
+ for a: ast::arg in f.decl.inputs { set_add(decls, a.id); }
};
let walk_expr = lambda(expr: &@ast::expr) {
alt expr.node {
@@ -87,7 +87,7 @@ fn collect_freevars(def_map: &resolve::def_map, sess: &session::session,
// node ids of the definitions.
let canonical_refs = ~[];
let defs = new_int_hash();
- for ref_id_: ast::node_id in *refs {
+ for ref_id_: ast::node_id in *refs {
let ref_id = ref_id_;
let def_id = ast::def_id_of_def(def_map.get(ref_id)).node;
if !decls.contains_key(def_id) && !defs.contains_key(def_id) {
View
40 src/comp/middle/resolve.rs
@@ -239,7 +239,7 @@ fn map_crate(e: &@env, c: &@ast::crate) {
}
fn resolve_imports(e: &env) {
- for each it: @{key: ast::node_id, val: import_state} in e.imports.items()
+ for each it: @{key: ast::node_id, val: import_state} in e.imports.items()
{
alt it.val {
todo(item, sc) { resolve_import(e, item, sc); }
@@ -345,7 +345,7 @@ fn visit_fn_with_scope(e: &@env, f: &ast::_fn, tp: &[ast::ty_param],
// here's where we need to set up the mapping
// for f's constrs in the table.
- for c: @ast::constr in f.decl.constraints {
+ for c: @ast::constr in f.decl.constraints {
resolve_constr(e, id, c, sc, v);
}
visit::visit_fn(f, tp, sp, name, id,
@@ -531,7 +531,7 @@ fn unresolved_err(e: &env, sc: &scopes, sp: &span, name: &ident, kind: &str) {
fail;
}
let err_scope = find_fn_or_mod_scope(sc);
- for rs: {ident: str, sc: scope} in e.reported {
+ for rs: {ident: str, sc: scope} in e.reported {
if str::eq(rs.ident, name) && err_scope == rs.sc { ret; }
}
e.reported += ~[{ident: name, sc: err_scope}];
@@ -704,7 +704,7 @@ fn lookup_in_scope(e: &env, sc: scopes, sp: &span, name: &ident,
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 {
+ for tp: ast::ty_param in ty_params {
if str::eq(tp.ident, name) { ret some(ast::def_ty_arg(i,tp.kind)); }
i += 1u;
}
@@ -727,7 +727,7 @@ fn lookup_in_fn(name: &ident, decl: &ast::fn_decl,
option::t[def] {
alt ns {
ns_value. {
- for a: ast::arg in decl.inputs {
+ for a: ast::arg in decl.inputs {
if str::eq(a.ident, name) {
ret some(ast::def_arg(local_def(a.id)));
}
@@ -743,7 +743,7 @@ fn lookup_in_obj(name: &ident, ob: &ast::_obj, ty_params: &[ast::ty_param],
ns: namespace) -> option::t[def] {
alt ns {
ns_value. {
- for f: ast::obj_field in ob.fields {
+ for f: ast::obj_field in ob.fields {
if str::eq(f.ident, name) {
ret some(ast::def_obj_field(local_def(f.id)));
}
@@ -779,7 +779,7 @@ fn lookup_in_block(name: &ident, b: &ast::blk_, ns: namespace) ->
ret some(ast::def_ty(local_def(it.id)));
}
} else if (ns == ns_value) {
- for v: ast::variant in variants {
+ for v: ast::variant in variants {
if str::eq(v.node.name, name) {
let i = v.node.id;
ret some(ast::def_variant(local_def(it.id),
@@ -971,7 +971,7 @@ fn lookup_glob_in_mod(e: &env, info: @indexed_mod, sp: &span, id: &ident,
} else if (ivec::len(matches) == 1u) {
ret some(matches.(0).def);
} else {
- for match: glob_imp_def in matches {
+ for match: glob_imp_def in matches {
let sp = match.item.span;
e.sess.span_note(sp, #fmt("'%s' is imported here", id));
}
@@ -1053,7 +1053,7 @@ fn add_to_index(index: &hashmap[ident, list[mod_index_entry]], id: &ident,
fn index_mod(md: &ast::_mod) -> mod_index {
let index = new_str_hash[list[mod_index_entry]]();
- for it: @ast::view_item in md.view_items {
+ for it: @ast::view_item in md.view_items {
alt it.node {
ast::view_item_import(ident, _, _) | ast::view_item_use(ident, _, _)
{
@@ -1065,7 +1065,7 @@ fn index_mod(md: &ast::_mod) -> mod_index {
}
}
}
- for it: @ast::item in md.items {
+ for it: @ast::item in md.items {
alt it.node {
ast::item_const(_, _) | ast::item_fn(_, _) | ast::item_mod(_) |
ast::item_native_mod(_) | ast::item_ty(_, _) |
@@ -1075,7 +1075,7 @@ fn index_mod(md: &ast::_mod) -> mod_index {
ast::item_tag(variants, _) {
add_to_index(index, it.ident, mie_item(it));
let variant_idx: uint = 0u;
- for v: ast::variant in variants {
+ for v: ast::variant in variants {
add_to_index(index, v.node.name,
mie_tag_variant(it, variant_idx));
variant_idx += 1u;
@@ -1088,7 +1088,7 @@ fn index_mod(md: &ast::_mod) -> mod_index {
fn index_nmod(md: &ast::native_mod) -> mod_index {
let index = new_str_hash[list[mod_index_entry]]();
- for it: @ast::view_item in md.view_items {
+ for it: @ast::view_item in md.view_items {
alt it.node {
ast::view_item_use(ident, _, _) | ast::view_item_import(ident, _, _)
{
@@ -1097,7 +1097,7 @@ fn index_nmod(md: &ast::native_mod) -> mod_index {
ast::view_item_import_glob(_, _) | ast::view_item_export(_, _) { }
}
}
- for it: @ast::native_item in md.items {
+ for it: @ast::native_item in md.items {
add_to_index(index, it.ident, mie_native_item(it));
}
ret index;
@@ -1125,7 +1125,7 @@ fn ns_for_def(d: def) -> 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) {
+ for d: def in csearch::lookup_defs(e.sess.get_cstore(), cnum, ids) {
e.ext_map.insert(ast::def_id_of_def(d), ids);
if ns == ns_for_def(d) { ret some(d); }
}
@@ -1211,7 +1211,7 @@ fn check_item(e: &@env, i: &@ast::item, x: &(), v: &vt[()]) {
ast::item_obj(ob, ty_params, _) {
fn field_name(field: &ast::obj_field) -> ident { ret field.ident; }
ensure_unique(*e, i.span, ob.fields, field_name, "object field");
- for m: @ast::method in ob.methods {
+ for m: @ast::method in ob.methods {
check_fn(*e, m.span, m.node.meth);
}
ensure_unique(*e, i.span, typaram_names(ty_params),
@@ -1249,7 +1249,7 @@ fn check_arm(e: &@env, a: &ast::arm, x: &(), v: &vt[()]) {
e.sess.span_err(a.pats.(i).span,
"inconsistent number of bindings");
} else {
- for name: ident in ch.seen {
+ for name: ident in ch.seen {
if is_none(ivec::find(bind str::eq(name, _), seen0)) {
// Fight the alias checker
let name_ = name;
@@ -1267,7 +1267,7 @@ fn check_block(e: &@env, b: &ast::blk, x: &(), v: &vt[()]) {
let values = checker(*e, "value");
let types = checker(*e, "type");
let mods = checker(*e, "module");
- for st: @ast::stmt in b.node.stmts {
+ for st: @ast::stmt in b.node.stmts {
alt st.node {
ast::stmt_decl(d, _) {
alt d.node {
@@ -1280,7 +1280,7 @@ fn check_block(e: &@env, b: &ast::blk, x: &(), v: &vt[()]) {
alt it.node {
ast::item_tag(variants, _) {
add_name(types, it.span, it.ident);
- for v: ast::variant in variants {
+ for v: ast::variant in variants {
add_name(values, v.span, v.node.name);
}
}
@@ -1340,7 +1340,7 @@ fn checker(e: &env, kind: str) -> checker {
}
fn add_name(ch: &checker, sp: &span, name: &ident) {
- for s: ident in ch.seen {
+ for s: ident in ch.seen {
if str::eq(s, name) {
ch.sess.span_fatal(sp, "duplicate " + ch.kind + " name: " + name);
}
@@ -1353,7 +1353,7 @@ fn ident_id(i: &ident) -> ident { ret i; }
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)); }
+ for elt: T in elts { add_name(ch, sp, id(elt)); }
}
// Local Variables:
View
122 src/comp/middle/trans.rs
@@ -95,7 +95,7 @@ fn type_of(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
fn type_of_explicit_args(cx: &@crate_ctxt, sp: &span, inputs: &[ty::arg]) ->
[TypeRef] {
let atys: [TypeRef] = ~[];
- for arg: ty::arg in inputs {
+ for arg: ty::arg in inputs {
let t: TypeRef = type_of_inner(cx, sp, arg.ty);
t = alt arg.mode {
ty::mo_alias(_) { T_ptr(t) }
@@ -231,7 +231,7 @@ fn type_of_inner(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> TypeRef {
ty::ty_task. { llty = T_taskptr(*cx); }
ty::ty_rec(fields) {
let tys: [TypeRef] = ~[];
- for f: ty::field in fields {
+ for f: ty::field in fields {
tys += ~[type_of_inner(cx, sp, f.mt.ty)];
}
llty = T_struct(tys);
@@ -305,7 +305,7 @@ fn type_of_or_i8(bcx: &@block_ctxt, typ: ty::t) -> TypeRef {
// gas doesn't!
fn sanitize(s: &str) -> str {
let result = "";
- for c: u8 in s {
+ for c: u8 in s {
if c == '@' as u8 {
result += "boxed_";
} else {
@@ -401,7 +401,7 @@ fn trans_native_call(b: &builder, glues: @glue_fns, lltaskptr: 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] = ~[];
- for a: ValueRef in args { call_args += ~[b.ZExtOrBitCast(a, T_int())]; }
+ for a: ValueRef in args { call_args += ~[b.ZExtOrBitCast(a, T_int())]; }
ret b.Call(llnative, call_args);
}
@@ -528,7 +528,7 @@ fn static_size_of_tag(cx: &@crate_ctxt, sp: &span, t: &ty::t) -> uint {
let max_size = 0u;
let variants = ty::tag_variants(cx.tcx, tid);
- for variant: ty::variant_info in variants {
+ for variant: ty::variant_info in variants {
let tup_ty =
simplify_type(cx, ty::mk_tup(cx.tcx, variant.args));
// Perform any type parameter substitutions.
@@ -562,7 +562,7 @@ fn dynamic_size_of(cx: &@block_ctxt, t: ty::t) -> result {
let off = C_int(0);
let max_align = C_int(1);
let bcx = cx;
- for e: ty::t in elts {
+ for e: ty::t in elts {
let elt_align = align_of(bcx, e);
bcx = elt_align.bcx;
let elt_size = size_of(bcx, e);
@@ -581,7 +581,7 @@ fn dynamic_size_of(cx: &@block_ctxt, t: ty::t) -> result {
}
ty::ty_rec(flds) {
let tys: [ty::t] = ~[];
- for f: ty::field in flds { tys += ~[f.mt.ty]; }
+ for f: ty::field in flds { tys += ~[f.mt.ty]; }
ret align_elements(cx, tys);
}
ty::ty_tup(elts) {
@@ -596,12 +596,12 @@ fn dynamic_size_of(cx: &@block_ctxt, t: ty::t) -> result {
let max_size: ValueRef = alloca(bcx, T_int());
bcx.build.Store(C_int(0), max_size);
let variants = ty::tag_variants(bcx_tcx(bcx), tid);
- for variant: ty::variant_info in variants {
+ 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] = ~[];
- for raw_ty: ty::t in raw_tys {
+ for raw_ty: ty::t in raw_tys {
let t = ty::substitute_type_params(bcx_tcx(cx), tps, raw_ty);
tys += ~[t];
}
@@ -640,7 +640,7 @@ fn dynamic_align_of(cx: &@block_ctxt, t: &ty::t) -> result {
ty::ty_rec(flds) {
let a = C_int(1);
let bcx = cx;
- for f: ty::field in flds {
+ for f: ty::field in flds {
let align = align_of(bcx, f.mt.ty);
bcx = align.bcx;
a = umax(bcx, a, align.val);
@@ -674,7 +674,7 @@ fn dynamic_align_of(cx: &@block_ctxt, t: &ty::t) -> result {
// in C_int()
fn GEPi(cx: &@block_ctxt, base: ValueRef, ixs: &[int]) -> ValueRef {
let v: [ValueRef] = ~[];
- for i: int in ixs { v += ~[C_int(i)]; }
+ for i: int in ixs { v += ~[C_int(i)]; }
ret cx.build.InBoundsGEP(base, v);
}
@@ -765,7 +765,7 @@ fn GEP_tup_like(cx: &@block_ctxt, t: &ty::t, base: ValueRef, ixs: &[int]) ->
let s = split_type(bcx_ccx(cx), t, ixs, 0u);
let args = ~[];
- for typ: ty::t in s.prefix { args += ~[typ]; }
+ for typ: ty::t in s.prefix { args += ~[typ]; }
let prefix_ty = ty::mk_tup(bcx_tcx(cx), args);
let bcx = cx;
@@ -789,7 +789,7 @@ fn GEP_tag(cx: @block_ctxt, llblobptr: ValueRef, tag_id: &ast::def_id,
let i = 0;
let true_arg_tys: [ty::t] = ~[];
- for aty: ty::t in arg_tys {
+ 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];
if i == ix { elem_ty = arg_ty; }
@@ -909,7 +909,7 @@ fn linearize_ty_params(cx: &@block_ctxt, t: &ty::t) ->
alt ty::struct(bcx_tcx(r.cx), t) {
ty::ty_param(pid,_) {
let seen: bool = false;
- for d: uint in r.defs { if d == pid { seen = true; } }
+ for d: uint in r.defs { if d == pid { seen = true; } }
if !seen {
r.vals += ~[r.cx.fcx.lltydescs.(pid)];
r.defs += ~[pid];
@@ -983,7 +983,7 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: &ty::t, escapes: bool,
let tdp = bcx.build.GEP(tydescs, ~[C_int(0), C_int(i)]);
bcx.build.Store(root, tdp);
i += 1;
- for td: ValueRef in tys.descs {
+ for td: ValueRef in tys.descs {
let tdp = bcx.build.GEP(tydescs, ~[C_int(0), C_int(i)]);
bcx.build.Store(td, tdp);
i += 1;
@@ -1002,7 +1002,7 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: &ty::t, escapes: bool,
alloca(bcx, T_array(T_ptr(bcx_ccx(bcx).tydesc_type),
n_params + 1u));
let i = 0;
- for td: ValueRef in tys.descs {
+ for td: ValueRef in tys.descs {
let tdp = bcx.build.GEP(llparamtydescs, ~[C_int(0), C_int(i)]);
bcx.build.Store(td, tdp);
i += 1;
@@ -1173,7 +1173,7 @@ fn make_generic_glue_inner(cx: &@local_ctxt, sp: &span, t: &ty::t,
// TODO: Implement some kind of freeze operation in the standard library.
let lltydescs_frozen = ~[];
- for lltydesc: ValueRef in lltydescs { lltydescs_frozen += ~[lltydesc]; }
+ for lltydesc: ValueRef in lltydescs { lltydescs_frozen += ~[lltydesc]; }
fcx.lltydescs = lltydescs_frozen;
let bcx = new_top_block_ctxt(fcx);
@@ -1201,7 +1201,7 @@ fn make_generic_glue(cx: &@local_ctxt, sp: &span, t: &ty::t, llfn: ValueRef,
}
fn emit_tydescs(ccx: &@crate_ctxt) {
- for each pair: @{key: ty::t, val: @tydesc_info} in ccx.tydescs.items() {
+ for each pair: @{key: ty::t, val: @tydesc_info} in ccx.tydescs.items() {
let glue_fn_ty = T_ptr(T_glue_fn(*ccx));
let cmp_fn_ty = T_ptr(T_cmp_glue_fn(*ccx));
let ti = pair.val;
@@ -1518,7 +1518,7 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: &ast::def_id,
cx.build.Load(cx.build.GEP(dtor_pair,
~[C_int(0), C_int(abi::fn_field_box)]));
let args = ~[cx.fcx.llretptr, cx.fcx.lltaskptr, dtor_env];
- for tp: ty::t in tps {
+ for tp: ty::t in tps {
let ti: option::t[@tydesc_info] = none;
let td = get_tydesc(cx, tp, false, ti);
args += ~[td.val];
@@ -1814,7 +1814,7 @@ fn iter_structural_ty_full(cx: &@block_ctxt, av: ValueRef, t: &ty::t,
alt ty::struct(ccx.tcx, fn_ty) {
ty::ty_fn(_, args, _, _, _) {
let j = 0;
- for a: ty::arg in args {
+ for a: ty::arg in args {
let rslt = GEP_tag(cx, a_tup, tid, variant.id, tps, j);
let llfldp_a = rslt.val;
cx = rslt.bcx;
@@ -1883,7 +1883,7 @@ fn iter_structural_ty_full(cx: &@block_ctxt, av: ValueRef, t: &ty::t,
let llswitch = bcx.build.Switch(lldiscrim_a, unr_cx.llbb, n_variants);
let next_cx = new_sub_block_ctxt(bcx, "tag-iter-next");
let i = 0u;
- for variant: ty::variant_info in variants {
+ for variant: ty::variant_info in variants {
let variant_cx =
new_sub_block_ctxt(bcx,
"tag-iter-variant-" +
@@ -2041,7 +2041,7 @@ fn lazily_emit_all_tydesc_glue(cx: &@block_ctxt,
fn lazily_emit_all_generic_info_tydesc_glues(cx: &@block_ctxt,
gi: &generic_info) {
- for ti: option::t[@tydesc_info] in gi.static_tis {
+ for ti: option::t[@tydesc_info] in gi.static_tis {
lazily_emit_all_tydesc_glue(cx, ti);
}
}
@@ -3386,7 +3386,7 @@ fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &[result]) ->
let live: [result] = ~[];
let vals: [ValueRef] = ~[];
let bbs: [BasicBlockRef] = ~[];
- for r: result in ins {
+ for r: result in ins {
if !is_terminated(r.bcx) {
live += ~[r];
vals += ~[r.val];
@@ -3407,14 +3407,14 @@ fn join_results(parent_cx: &@block_ctxt, t: TypeRef, ins: &[result]) ->
// We have >1 incoming edges. Make a join block and br+phi them into it.
let join_cx = new_sub_block_ctxt(parent_cx, "join");
- for r: result in live { r.bcx.build.Br(join_cx.llbb); }
+ for r: result in live { r.bcx.build.Br(join_cx.llbb); }
let phi = join_cx.build.Phi(t, vals, bbs);
ret rslt(join_cx, phi);
}
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 {
+ for r: result in ins {
if !is_terminated(r.bcx) { r.bcx.build.Br(out.llbb); }
}
ret out;
@@ -3571,7 +3571,7 @@ fn build_environment(bcx: @block_ctxt, lltydescs: [ValueRef],
GEP_tup_like(bcx, closure_ty, closure,
~[0, abi::closure_elt_bindings]);
bcx = bindings.bcx;
- for lv: lval_result in bound_vals {
+ for lv: lval_result in bound_vals {
let bound = GEP_tup_like(bcx, bindings_ty, bindings.val,
~[0, i as int]);
bcx = bound.bcx;
@@ -3591,7 +3591,7 @@ fn build_environment(bcx: @block_ctxt, lltydescs: [ValueRef],
~[0, abi::closure_elt_ty_params]);
bcx = ty_params_slot.bcx;
i = 0u;
- for td: ValueRef in lltydescs {
+ for td: ValueRef in lltydescs {
let ty_param_slot = GEPi(bcx, ty_params_slot.val, ~[0, i as int]);
bcx.build.Store(td, ty_param_slot);
i += 1u;
@@ -3612,7 +3612,7 @@ fn build_closure(cx: &@block_ctxt, upvars: &@[ast::node_id], copying: bool)
closure_tys += ~[option::get(cx.fcx.iterbodyty)];
}
// Package up the upvars
- for nid: ast::node_id in *upvars {
+ for nid: ast::node_id in *upvars {
closure_vals += ~[trans_var(cx, cx.sp, nid)];
let ty = ty::node_id_to_monotype(bcx_tcx(cx), nid);
if !copying { ty = ty::mk_mut_ptr(bcx_tcx(cx), ty); }
@@ -3689,7 +3689,7 @@ fn load_environment(enclosing_cx: &@block_ctxt, fcx: &@fn_ctxt,
i += 1u;
}
// Load the acutal upvars.
- for upvar_id: ast::node_id in *upvars {
+ for upvar_id: ast::node_id in *upvars {
let upvarptr =
GEP_tup_like(bcx, ty, llclosure, path + ~[i as int]);
bcx = upvarptr.bcx;
@@ -3875,7 +3875,7 @@ fn lval_generic_fn(cx: &@block_ctxt, tpt: &ty::ty_param_kinds_and_ty,
let bcx = lv.res.bcx;
let tydescs: [ValueRef] = ~[];
let tis: [option::t[@tydesc_info]] = ~[];
- for t: ty::t in tys {
+ for t: ty::t in tys {
// TODO: Doesn't always escape.
let ti = none[@tydesc_info];
@@ -4368,7 +4368,7 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
let outgoing_arg_index: uint = 0u;
let llout_arg_tys: [TypeRef] =
type_of_explicit_args(cx.ccx, sp, outgoing_args);
- for arg: option::t[@ast::expr] in args {
+ for arg: option::t[@ast::expr] in args {
let out_arg = outgoing_args.(outgoing_arg_index);
let llout_arg_ty = llout_arg_tys.(outgoing_arg_index);
let is_val = out_arg.mode == ty::mo_val;
@@ -4452,7 +4452,7 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
args: &[option::t[@ast::expr]], id: ast::node_id) ->
result {
let bound: [@ast::expr] = ~[];
- for argopt: option::t[@ast::expr] in args {
+ for argopt: option::t[@ast::expr] in args {
alt argopt { none. { } some(e) { bound += ~[e]; } }
}
@@ -4487,7 +4487,7 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
let bound_tys: [ty::t] = ~[outgoing_fty];
let bound_vals: [lval_result] = ~[bound_f];
// Translate the bound expressions.
- for e: @ast::expr in bound {
+ for e: @ast::expr in bound {
let lv = trans_lval(bcx, e);
bcx = lv.res.bcx;
bound_vals += ~[lv];
@@ -4660,7 +4660,7 @@ fn trans_args(cx: &@block_ctxt, llenv: ValueRef,
// to cast her view of the arguments to the caller's view.
let arg_tys = type_of_explicit_args(bcx_ccx(cx), cx.sp, args);
let i = 0u;
- for e: @ast::expr in es {
+ for e: @ast::expr in es {
if bcx.build.is_terminated() {
// This means an earlier arg was divergent.
// So this arg can't be evaluated.
@@ -4816,7 +4816,7 @@ fn trans_vec(cx: &@block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
std::ivec::init_elt[ty::t](unit_ty,
std::ivec::len(args)));
let i: int = 0;
- for e: @ast::expr in args {
+ for e: @ast::expr in args {
let src = trans_lval(bcx, e);
bcx = src.res.bcx;
let dst_res = GEP_tup_like(bcx, pseudo_tup_ty, body, ~[0, i]);
@@ -4924,7 +4924,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
// Store the individual elements.
let i = 0u;
- for e: @ast::expr in args {
+ for e: @ast::expr in args {
let lv = trans_lval(bcx, e);
bcx = lv.res.bcx;
let lleltptr;
@@ -4961,12 +4961,12 @@ fn trans_rec(cx: &@block_ctxt, fields: &[ast::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 {
+ for tf: ty::field in ty_fields {
let e_ty = tf.mt.ty;
let dst_res = GEP_tup_like(bcx, t, rec_val, ~[0, i]);
bcx = dst_res.bcx;
let expr_provided = false;
- for f: ast::field in fields {
+ for f: ast::field in fields {
if str::eq(f.node.ident, tf.ident) {
expr_provided = true;
let lv = trans_lval(bcx, f.node.expr);
@@ -5525,7 +5525,7 @@ fn trans_stmt(cx: &@block_ctxt, s: &ast::stmt) -> result {
ast::stmt_decl(d, _) {
alt d.node {
ast::decl_local(locals) {
- for local: @ast::local in locals {
+ for local: @ast::local in locals {
bcx = init_local(bcx, local).bcx;
}
}
@@ -5624,7 +5624,7 @@ fn trans_block_cleanups(cx: &@block_ctxt, cleanup_cx: &@block_ctxt) ->
iter block_locals(b: &ast::blk) -> @ast::local {
// FIXME: putting from inside an iter block doesn't work, so we can't
// use the index here.
- for s: @ast::stmt in b.node.stmts {
+ for s: @ast::stmt in b.node.stmts {
alt s.node {
ast::stmt_decl(d, _) {
alt d.node {
@@ -5725,7 +5725,7 @@ fn trans_block(cx: &@block_ctxt, b: &ast::blk, output: &out_method) ->
bcx.fcx.lllocals.insert(local.node.id, r.val);
}
let r = rslt(bcx, C_nil());
- for s: @ast::stmt in b.node.stmts {
+ for s: @ast::stmt in b.node.stmts {
r = trans_stmt(bcx, *s);
bcx = r.bcx;
@@ -5868,7 +5868,7 @@ fn create_llargs_for_fn_args(cx: &@fn_ctxt, proto: ast::proto,
some(tt) { cx.llself = some[val_self_pair]({v: cx.llenv, t: tt}); }
none. {
let i = 0u;
- for tp: ast::ty_param in ty_params {
+ for tp: ast::ty_param in ty_params {
let llarg = llvm::LLVMGetParam(cx.llfn, arg_n);
assert (llarg as int != 0);
cx.lltydescs += ~[llarg];
@@ -5891,7 +5891,7 @@ fn create_llargs_for_fn_args(cx: &@fn_ctxt, proto: ast::proto,
// Populate the llargs field of the function context with the ValueRefs
// that we get from llvm::LLVMGetParam for each argument.
- for arg: ast::arg in args {
+ for arg: ast::arg in args {
let llarg = llvm::LLVMGetParam(cx.llfn, arg_n);
assert (llarg as int != 0);
cx.llargs.insert(arg.id, llarg);
@@ -5903,7 +5903,7 @@ 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 {
+ for aarg: ast::arg in args {
if aarg.mode == ast::val {
let argval;
alt bcx.fcx.llargs.find(aarg.id) {
@@ -5925,7 +5925,7 @@ 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]) {
let arg_n: uint = 0u;
- for aarg: ast::arg in args {
+ for aarg: ast::arg in args {
if aarg.mode == ast::val || aarg.mode == ast::move {
let argval;
alt bcx.fcx.llargs.find(aarg.id) {
@@ -5955,7 +5955,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] = ~[];
- for f: ast::obj_field in bcx.fcx.lcx.obj_fields {
+ for f: ast::obj_field in bcx.fcx.lcx.obj_fields {
field_tys += ~[node_id_type(bcx_ccx(bcx), f.id)];
}
// Synthesize a tuple type for the fields so that GEP_tup_like() can work
@@ -5986,7 +5986,7 @@ fn populate_fn_ctxt_from_llself(fcx: @fn_ctxt, llself: val_self_pair) {
obj_fields = vi2p(bcx, obj_fields, T_ptr(llfields_ty));
} else { obj_fields = vi2p(bcx, obj_fields, T_ptr(T_i8())); }
let i: int = 0;
- for p: ast::ty_param in fcx.lcx.obj_typarams {
+ for p: ast::ty_param in fcx.lcx.obj_typarams {
let lltyparam: ValueRef =
bcx.build.GEP(obj_typarams, ~[C_int(0), C_int(i)]);
lltyparam = bcx.build.Load(lltyparam);
@@ -5994,7 +5994,7 @@ fn populate_fn_ctxt_from_llself(fcx: @fn_ctxt, llself: val_self_pair) {
i += 1;
}
i = 0;
- for f: ast::obj_field in fcx.lcx.obj_fields {
+ for f: ast::obj_field in fcx.lcx.obj_fields {
let rslt = GEP_tup_like(bcx, fields_tup_ty, obj_fields, ~[0, i]);
bcx = llstaticallocas_block_ctxt(fcx);
let llfield = rslt.val;
@@ -6166,7 +6166,7 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
let fn_args: [ast::arg] = ~[];
let i = 0u;
- for varg: ast::variant_arg in variant.node.args {
+ for varg: ast::variant_arg in variant.node.args {
fn_args +=
~[{mode: ast::alias(false),
ty: varg.ty,
@@ -6188,7 +6188,7 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
fn_args, ty_params);
let ty_param_substs: [ty::t] = ~[];
i = 0u;
- for tp: ast::ty_param in ty_params {
+ for tp: ast::ty_param in ty_params {
ty_param_substs += ~[ty::mk_param(cx.ccx.tcx, i, tp.kind)];
i += 1u;
}
@@ -6210,7 +6210,7 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
bcx.build.GEP(lltagptr, ~[C_int(0), C_int(1)])
};
i = 0u;
- for va: ast::variant_arg in variant.node.args {
+ for va: ast::variant_arg in variant.node.args {
let rslt =
GEP_tag(bcx, llblobptr, ast::local_def(tag_id),
ast::local_def(variant.node.id), ty_param_substs,
@@ -6313,7 +6313,7 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
let sub_cx = extend_path(cx, item.ident);
let degen = std::ivec::len(variants) == 1u;
let i = 0;
- for variant: ast::variant in variants {
+ for variant: ast::variant in variants {
trans_tag_variant(sub_cx, item.id, variant, i, degen, tps);
i += 1;
}
@@ -6330,7 +6330,7 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
// only as a convenience for humans working with the code, to organize names
// and control visibility.
fn trans_mod(cx: @local_ctxt, m: &ast::_mod) {
- for item: @ast::item in m.items { trans_item(cx, *item); }
+ for item: @ast::item in m.items { trans_item(cx, *item); }
}
fn get_pair_fn_ty(llpairty: TypeRef) -> TypeRef {
@@ -6525,7 +6525,7 @@ fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str],
if uses_retptr { call_args += ~[bcx.fcx.llretptr]; }
let arg_n = 3u;
- for each i: uint in uint::range(0u, num_ty_param) {
+ for each i: uint in uint::range(0u, num_ty_param) {
let llarg = llvm::LLVMGetParam(fcx.llfn, arg_n);
fcx.lltydescs += ~[llarg];
assert (llarg as int != 0);
@@ -6558,7 +6558,7 @@ fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str],
first_arg_n: uint, uses_retptr: bool, cc: uint)
-> {val: ValueRef, rptr: ValueRef} {
let call_arg_tys: [TypeRef] = ~[];
- for arg: ValueRef in call_args { call_arg_tys += ~[val_ty(arg)]; }
+ for arg: ValueRef in call_args { call_arg_tys += ~[val_ty(arg)]; }
let llnativefnty;
if uses_retptr {
@@ -6586,7 +6586,7 @@ fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str],
let drop_args: [{val: ValueRef, ty: ty::t}] = ~[];
let i = arg_n;
- for arg: ty::arg in args {
+ for arg: ty::arg in args {
let llarg = llvm::LLVMGetParam(fcx.llfn, i);
assert (llarg as int != 0);
if cast_to_i32 {
@@ -6638,7 +6638,7 @@ fn decl_native_fn_and_pair(ccx: &@crate_ctxt, sp: &span, path: &[str],
if !rty_is_nil && !uses_retptr { bcx.build.Store(r, rptr); }
- for d: {val: ValueRef, ty: ty::t} in drop_args {
+ for d: {val: ValueRef, ty: ty::t} in drop_args {
bcx = drop_ty(bcx, d.val, d.ty).bcx;
}
bcx.build.RetVoid();
@@ -6690,7 +6690,7 @@ fn collect_item_2(ccx: &@crate_ctxt, i: &@ast::item, pt: &[str],
}
ast::item_obj(ob, tps, ctor_id) {
decl_fn_and_pair(ccx, i.span, new_pt, "obj_ctor", tps, ctor_id);
- for m: @ast::method in ob.methods {
+ for m: @ast::method in ob.methods {
ccx.obj_methods.insert(m.node.id, ());
}
}
@@ -6724,7 +6724,7 @@ fn collect_tag_ctor(ccx: @crate_ctxt, i: &@ast::item, pt: &[str],
visit::visit_item(i, new_pt, v);
alt i.node {
ast::item_tag(variants, tps) {
- for variant: ast::variant in variants {
+ for variant: ast::variant in variants {
if std::ivec::len(variant.node.args) != 0u {
decl_fn_and_pair(ccx, i.span, new_pt + ~[variant.node.name],
"tag", tps, variant.node.id);
@@ -6891,7 +6891,7 @@ fn create_module_map(ccx: &@crate_ctxt) -> ValueRef {
llvm::LLVMSetLinkage(map,
lib::llvm::LLVMInternalLinkage as llvm::Linkage);
let elts: [ValueRef] = ~[];
- for each item: @{key: str, val: ValueRef} in ccx.module_data.items() {
+ 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];
}
@@ -7040,7 +7040,7 @@ fn trans_crate(sess: &session::session, crate: &@ast::crate, tcx: &ty::ctxt,
log_err #fmt("n_real_glues: %u", ccx.stats.n_real_glues);
- for timing: {ident: str, time: int} in *ccx.stats.fn_times {
+ for timing: {ident: str, time: int} in *ccx.stats.fn_times {
log_err #fmt("time: %s took %d ms", timing.ident, timing.time);
}
}
View
34 src/comp/middle/trans_alt.rs
@@ -47,7 +47,7 @@ fn variant_opt(ccx: &@crate_ctxt, pat_id: ast::node_id) -> opt {
let vdef = ast::variant_def_ids(ccx.tcx.def_map.get(pat_id));
let variants = ty::tag_variants(ccx.tcx, vdef.tg);
let i = 0u;
- for v: ty::variant_info in variants {
+ for v: ty::variant_info in variants {
if vdef.var == v.id { ret var(i, vdef); }
i += 1u;
}
@@ -81,7 +81,7 @@ 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 = ~[];
- for br: match_branch in m {
+ for br: match_branch in m {
alt e(br.pats.(col)) {
some(sub) {
let pats =
@@ -132,9 +132,9 @@ fn enter_rec(m: &match, col: uint, fields: &[ast::ident], val: ValueRef) ->
alt p.node {
ast::pat_rec(fpats, _) {
let pats = ~[];
- for fname: ast::ident in fields {
+ for fname: ast::ident in fields {
let pat = dummy;
- for fpat: ast::field_pat in fpats {
+ for fpat: ast::field_pat in fpats {
if str::eq(fpat.ident, fname) { pat = fpat.pat; break; }
}
pats += ~[pat];
@@ -172,12 +172,12 @@ fn enter_box(m: &match, col: uint, val: ValueRef) -> match {
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; } }
+ for l: opt in set { if opt_eq(l, val) { ret; } }
set += ~[val];
}
let found = ~[];
- for br: match_branch in m {
+ for br: match_branch in m {
alt br.pats.(col).node {
ast::pat_lit(l) { add_to_set(found, lit(l)); }
ast::pat_tag(_, _) {
@@ -219,10 +219,10 @@ fn extract_variant_args(bcx: @block_ctxt, pat_id: ast::node_id,
fn collect_record_fields(m: &match, col: uint) -> [ast::ident] {
let fields = ~[];
- for br: match_branch in m {
+ for br: match_branch in m {
alt br.pats.(col).node {
ast::pat_rec(fs, _) {
- for f: ast::field_pat in fs {
+ for f: ast::field_pat in fs {
if !ivec::any(bind str::eq(f.ident, _), fields) {
fields += ~[f.ident];
}
@@ -235,7 +235,7 @@ fn collect_record_fields(m: &match, col: uint) -> [ast::ident] {
}
fn any_box_pat(m: &match, col: uint) -> bool {
- for br: match_branch in m {
+ for br: match_branch in m {
alt br.pats.(col).node { ast::pat_box(_) { ret true; } _ { } }
}
ret false;
@@ -296,7 +296,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
ivec::slice(vals, col + 1u, ivec::len(vals));
let ccx = bcx.fcx.lcx.ccx;
let pat_id = 0;
- for br: match_branch in m {
+ for br: match_branch in m {
// Find a real id (we're adding placeholder wildcard patterns, but
// each column is guaranteed to have at least one real pattern)
if pat_id == 0 { pat_id = br.pats.(col).id; }
@@ -385,7 +385,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
} else { C_int(0) }; // Placeholder for when not using a switch
// Compile subtrees for each option
- for opt: opt in opts {
+ for opt: opt in opts {
let opt_cx = new_sub_block_ctxt(bcx, "match_case");
alt kind {
single. { bcx.build.Br(opt_cx.llbb); }
@@ -432,7 +432,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
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 {
+ for elt: {ident: ast::ident, val: ValueRef} in list {
if str::eq(elt.ident, key) { ret some(elt.val); }
}
ret none;
@@ -440,10 +440,10 @@ fn make_phi_bindings(bcx: &@block_ctxt, map: &[exit_node],
let our_block = bcx.llbb as uint;
let success = true;
- for each item: @{key: ast::ident, val: ast::node_id} in ids.items() {
+ for each item: @{key: ast::ident, val: ast::node_id} in ids.items() {
let llbbs = ~[];
let vals = ~[];
<