Skip to content

Commit d13d852

Browse files
committed
---
yaml --- r: 6742 b: refs/heads/master c: 2833ca4 h: refs/heads/master v: v3
1 parent f7ee695 commit d13d852

38 files changed

+171
-170
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 0a3626161d5ebb1d2c6839773b0e533d3ec4589c
2+
refs/heads/master: 2833ca478c19d2f8f150570a6d60b93488debdcc

trunk/src/cargo/cargo.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
155155
name = str::slice(name, 0u, ri as uint);
156156
}
157157
log #fmt["Installing: %s", name];
158-
let old = vec::map({|x| str::slice(x, 2u, str::byte_len(x))},
159-
fs::list_dir("."));
158+
let old = vec::map(fs::list_dir("."),
159+
{|x| str::slice(x, 2u, str::byte_len(x))});
160160
run::run_program("rustc", [name + ".rc"]);
161-
let new = vec::map({|x| str::slice(x, 2u, str::byte_len(x))},
162-
fs::list_dir("."));
161+
let new = vec::map(fs::list_dir("."),
162+
{|x| str::slice(x, 2u, str::byte_len(x))});
163163
let created =
164-
vec::filter::<str>({ |n| !vec::member::<str>(n, old) }, new);
164+
vec::filter::<str>(new, { |n| !vec::member::<str>(n, old) });
165165
let exec_suffix = os::exec_suffix();
166166
for ct: str in created {
167167
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
@@ -184,7 +184,7 @@ fn install_source(c: cargo, path: str) {
184184
log #fmt["contents: %s", str::connect(contents, ", ")];
185185

186186
let cratefiles =
187-
vec::filter::<str>({ |n| str::ends_with(n, ".rc") }, contents);
187+
vec::filter::<str>(contents, { |n| str::ends_with(n, ".rc") });
188188

189189
if vec::is_empty(cratefiles) {
190190
fail "This doesn't look like a rust package (no .rc files).";

trunk/src/comp/back/rpath.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn get_sysroot_absolute_rt_lib(sess: session::session) -> fs::path {
4747
}
4848

4949
fn rpaths_to_flags(rpaths: [str]) -> [str] {
50-
vec::map({ |rpath| #fmt("-Wl,-rpath,%s",rpath)}, rpaths)
50+
vec::map(rpaths, { |rpath| #fmt("-Wl,-rpath,%s",rpath)})
5151
}
5252

5353
fn get_rpaths(os: session::os, cwd: fs::path, sysroot: fs::path,
@@ -96,7 +96,7 @@ fn get_rpaths_relative_to_output(os: session::os,
9696
cwd: fs::path,
9797
output: fs::path,
9898
libs: [fs::path]) -> [str] {
99-
vec::map(bind get_rpath_relative_to_output(os, cwd, output, _), libs)
99+
vec::map(libs, bind get_rpath_relative_to_output(os, cwd, output, _))
100100
}
101101

102102
fn get_rpath_relative_to_output(os: session::os,
@@ -150,7 +150,7 @@ fn get_relative_to(abs1: fs::path, abs2: fs::path) -> fs::path {
150150
}
151151

152152
fn get_absolute_rpaths(cwd: fs::path, libs: [fs::path]) -> [str] {
153-
vec::map(bind get_absolute_rpath(cwd, _), libs)
153+
vec::map(libs, bind get_absolute_rpath(cwd, _))
154154
}
155155

156156
fn get_absolute_rpath(cwd: fs::path, &&lib: fs::path) -> str {

trunk/src/comp/driver/rustc.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,9 @@ fn main(args: [str]) {
650650
let ofile = getopts::opt_maybe_str(match, "o");
651651
let cfg = build_configuration(sess, binary, ifile);
652652
let pretty =
653-
option::map::<str,
654-
pp_mode>(bind parse_pretty(sess, _),
655-
getopts::opt_default(match, "pretty",
656-
"normal"));
653+
option::map(getopts::opt_default(match, "pretty",
654+
"normal"),
655+
bind parse_pretty(sess, _));
657656
alt pretty {
658657
some::<pp_mode>(ppm) { pretty_print_input(sess, cfg, ifile, ppm); ret; }
659658
none::<pp_mode>. {/* continue */ }

trunk/src/comp/front/attr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn find_attrs_by_name(attrs: [ast::attribute], name: ast::ident) ->
5050
option::some(a)
5151
} else { option::none }
5252
}(_, name);
53-
ret vec::filter_map(filter, attrs);
53+
ret vec::filter_map(attrs, filter);
5454
}
5555

5656
fn get_attr_name(attr: ast::attribute) -> ast::ident {
@@ -66,7 +66,7 @@ fn find_meta_items_by_name(metas: [@ast::meta_item], name: ast::ident) ->
6666
option::some(m)
6767
} else { option::none }
6868
}(_, name);
69-
ret vec::filter_map(filter, metas);
69+
ret vec::filter_map(metas, filter);
7070
}
7171

7272
fn get_meta_item_name(meta: @ast::meta_item) -> ast::ident {
@@ -186,7 +186,7 @@ fn remove_meta_items_by_name(items: [@ast::meta_item], name: str) ->
186186
} else { option::none }
187187
}(_, name);
188188

189-
ret vec::filter_map(filter, items);
189+
ret vec::filter_map(items, filter);
190190
}
191191

192192
fn require_unique_names(sess: session::session, metas: [@ast::meta_item]) {

trunk/src/comp/front/config.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ fn filter_item(cfg: ast::crate_cfg, &&item: @ast::item) ->
2929
fn fold_mod(cfg: ast::crate_cfg, m: ast::_mod, fld: fold::ast_fold) ->
3030
ast::_mod {
3131
let filter = bind filter_item(cfg, _);
32-
let filtered_items = vec::filter_map(filter, m.items);
33-
ret {view_items: vec::map(fld.fold_view_item, m.view_items),
34-
items: vec::map(fld.fold_item, filtered_items)};
32+
let filtered_items = vec::filter_map(m.items, filter);
33+
ret {view_items: vec::map(m.view_items, fld.fold_view_item),
34+
items: vec::map(filtered_items, fld.fold_item)};
3535
}
3636

3737
fn filter_native_item(cfg: ast::crate_cfg, &&item: @ast::native_item) ->
@@ -44,8 +44,8 @@ fn filter_native_item(cfg: ast::crate_cfg, &&item: @ast::native_item) ->
4444
fn fold_native_mod(cfg: ast::crate_cfg, nm: ast::native_mod,
4545
fld: fold::ast_fold) -> ast::native_mod {
4646
let filter = bind filter_native_item(cfg, _);
47-
let filtered_items = vec::filter_map(filter, nm.items);
48-
ret {view_items: vec::map(fld.fold_view_item, nm.view_items),
47+
let filtered_items = vec::filter_map(nm.items, filter);
48+
ret {view_items: vec::map(nm.view_items, fld.fold_view_item),
4949
items: filtered_items};
5050
}
5151

@@ -69,10 +69,10 @@ fn filter_stmt(cfg: ast::crate_cfg, &&stmt: @ast::stmt) ->
6969
fn fold_block(cfg: ast::crate_cfg, b: ast::blk_, fld: fold::ast_fold) ->
7070
ast::blk_ {
7171
let filter = bind filter_stmt(cfg, _);
72-
let filtered_stmts = vec::filter_map(filter, b.stmts);
72+
let filtered_stmts = vec::filter_map(b.stmts, filter);
7373
ret {view_items: b.view_items,
74-
stmts: vec::map(fld.fold_stmt, filtered_stmts),
75-
expr: option::map(fld.fold_expr, b.expr),
74+
stmts: vec::map(filtered_stmts, fld.fold_stmt),
75+
expr: option::map(b.expr, fld.fold_expr),
7676
id: b.id,
7777
rules: b.rules};
7878
}
@@ -99,8 +99,8 @@ fn metas_in_cfg(cfg: ast::crate_cfg, metas: [@ast::meta_item]) -> bool {
9999
// Pull the inner meta_items from the #[cfg(meta_item, ...)] attributes,
100100
// so we can match against them. This is the list of configurations for
101101
// which the item is valid
102-
let cfg_metas = vec::concat(vec::filter_map(
103-
{|&&i| attr::get_meta_item_list(i)}, cfg_metas));
102+
let cfg_metas = vec::concat(vec::filter_map(cfg_metas,
103+
{|&&i| attr::get_meta_item_list(i)}));
104104

105105
let has_cfg_metas = vec::len(cfg_metas) > 0u;
106106
if !has_cfg_metas { ret true; }

trunk/src/comp/front/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn fold_mod(_cx: test_ctxt, m: ast::_mod, fld: fold::ast_fold) -> ast::_mod {
6161
}
6262

6363
let mod_nomain =
64-
{view_items: m.view_items, items: vec::filter_map(nomain, m.items)};
64+
{view_items: m.view_items, items: vec::filter_map(m.items, nomain)};
6565
ret fold::noop_fold_mod(mod_nomain, fld);
6666
}
6767

@@ -126,8 +126,8 @@ fn is_test_fn(i: @ast::item) -> bool {
126126
fn is_ignored(cx: test_ctxt, i: @ast::item) -> bool {
127127
let ignoreattrs = attr::find_attrs_by_name(i.attrs, "ignore");
128128
let ignoreitems = attr::attr_metas(ignoreattrs);
129-
let cfg_metas = vec::concat(vec::filter_map(
130-
{|&&i| attr::get_meta_item_list(i)}, ignoreitems));
129+
let cfg_metas = vec::concat(vec::filter_map(ignoreitems,
130+
{|&&i| attr::get_meta_item_list(i)}));
131131
ret if vec::is_not_empty(ignoreitems) {
132132
config::metas_in_cfg(cx.crate.node.config, cfg_metas)
133133
} else {

trunk/src/comp/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn get_dep_hashes(cstore: cstore) -> [str] {
140140
log #fmt(" hash[%s]: %s", x.name, x.hash);
141141
}
142142
fn mapper(ch: crate_hash) -> str { ret ch.hash; }
143-
ret vec::map(mapper, sorted);
143+
ret vec::map(sorted, mapper);
144144
}
145145
// Local Variables:
146146
// mode: rust

trunk/src/comp/metadata/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ fn resolve_path(path: [ast::ident], data: @[u8]) -> [ast::def_id] {
159159
ret result;
160160
}
161161

162-
163162
// FIXME doesn't yet handle renamed re-exported externals
164163
fn lookup_def(cnum: ast::crate_num, data: @[u8], did_: ast::def_id) ->
165164
ast::def {

trunk/src/comp/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ fn encode_crate_deps(ebml_w: ebml::writer, cstore: cstore::cstore) {
610610
fn name(kv: numname) -> str { kv.ident }
611611
// mutable -> immutable hack for vec::map
612612
let immpairs = vec::slice(pairs, 0u, vec::len(pairs));
613-
ret vec::map(name, immpairs);
613+
ret vec::map(immpairs, name);
614614
}
615615

616616
// We're just going to write a list of crate names, with the assumption

trunk/src/comp/middle/alias.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn check_alt(cx: ctx, input: @ast::expr, arms: [ast::arm], sc: scope,
325325
for pat in a.pats {
326326
for proot in pattern_roots(cx.tcx, root.mut, pat) {
327327
let canon_id = pat_id_map.get(proot.name);
328-
alt vec::find({|x| x.id == canon_id}, binding_info) {
328+
alt vec::find(binding_info, {|x| x.id == canon_id}) {
329329
some(s) { s.unsafe_tys += unsafe_set(proot.mut); }
330330
none. {
331331
binding_info += [
@@ -683,7 +683,7 @@ fn filter_invalid(src: list<@invalid>, bs: [binding]) -> list<@invalid> {
683683
while cur != list::nil {
684684
alt cur {
685685
list::cons(head, tail) {
686-
let p = vec::position_pred({|b| b.node_id == head.node_id}, bs);
686+
let p = vec::position_pred(bs, {|b| b.node_id == head.node_id});
687687
if !is_none(p) { out = list::cons(head, @out); }
688688
cur = *tail;
689689
}

trunk/src/comp/middle/kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
7878
let t = ty::expr_ty(cx.tcx, ex);
7979
let ty_fields = alt ty::struct(cx.tcx, t) { ty::ty_rec(f) { f } };
8080
for tf in ty_fields {
81-
if !vec::any({|f| f.node.ident == tf.ident}, fields) &&
81+
if !vec::any(fields, {|f| f.node.ident == tf.ident}) &&
8282
!kind_can_be_copied(ty::type_kind(cx.tcx, tf.mt.ty)) {
8383
cx.tcx.sess.span_err(ex.span,
8484
"copying a noncopyable value");

trunk/src/comp/middle/last_use.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn join_branches(branches: [set]) -> set {
197197
for set in branches {
198198
i += 1u;
199199
for {def, exprs} in set {
200-
if !vec::any({|v| v.def == def}, found) {
200+
if !vec::any(found, {|v| v.def == def}) {
201201
let j = i, ne = exprs;
202202
while j < l {
203203
for {def: d2, exprs} in branches[j] {
@@ -234,8 +234,8 @@ fn clear_in_current(cx: ctx, my_def: node_id, to: bool) {
234234
cx.last_uses.insert(expr, to);
235235
}
236236
}
237-
cx.current = vec::filter({|x| x.def != my_def},
238-
copy cx.current);
237+
cx.current = vec::filter(copy cx.current,
238+
{|x| x.def != my_def});
239239
break;
240240
}
241241
}

trunk/src/comp/middle/resolve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,8 @@ fn lookup_in_globs(e: env, globs: [glob_imp_def], sp: span, id: ident,
11521152
none. { none }
11531153
}
11541154
}
1155-
let matches = vec::filter_map(bind lookup_in_mod_(e, _, sp, id, ns, dr),
1156-
copy globs);
1155+
let matches = vec::filter_map(copy globs,
1156+
bind lookup_in_mod_(e, _, sp, id, ns, dr));
11571157
if vec::len(matches) == 0u {
11581158
ret none;
11591159
} else if vec::len(matches) == 1u {
@@ -1448,7 +1448,7 @@ fn check_arm(e: @env, a: ast::arm, &&x: (), v: vt<()>) {
14481448
"inconsistent number of bindings");
14491449
} else {
14501450
for name: ident in ch.seen {
1451-
if is_none(vec::find(bind str::eq(name, _), seen0)) {
1451+
if is_none(vec::find(seen0, bind str::eq(name, _))) {
14521452
// Fight the alias checker
14531453
let name_ = name;
14541454
e.sess.span_err(a.pats[i].span,

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,9 +3428,9 @@ fn trans_rec(bcx: @block_ctxt, fields: [ast::field],
34283428
let ty_fields = alt ty::struct(bcx_tcx(bcx), t) { ty::ty_rec(f) { f } };
34293429
let temp_cleanups = [];
34303430
for fld in fields {
3431-
let ix = option::get(vec::position_pred({|ft|
3431+
let ix = option::get(vec::position_pred(ty_fields, {|ft|
34323432
str::eq(fld.node.ident, ft.ident)
3433-
}, ty_fields));
3433+
}));
34343434
let dst = GEP_tup_like_1(bcx, t, addr, [0, ix as int]);
34353435
bcx = trans_expr_save_in(dst.bcx, fld.node.expr, dst.val);
34363436
add_clean_temp_mem(bcx, dst.val, ty_fields[ix].mt.ty);
@@ -3442,7 +3442,7 @@ fn trans_rec(bcx: @block_ctxt, fields: [ast::field],
34423442
bcx = cx;
34433443
// Copy over inherited fields
34443444
for tf in ty_fields {
3445-
if !vec::any({|f| str::eq(f.node.ident, tf.ident)}, fields) {
3445+
if !vec::any(fields, {|f| str::eq(f.node.ident, tf.ident)}) {
34463446
let dst = GEP_tup_like_1(bcx, t, addr, [0, i]);
34473447
let base = GEP_tup_like_1(bcx, t, base_val, [0, i]);
34483448
let val = load_if_immediate(base.bcx, base.val, tf.mt.ty);

trunk/src/comp/middle/trans_alt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn collect_record_fields(m: match, col: uint) -> [ast::ident] {
291291
alt br.pats[col].node {
292292
ast::pat_rec(fs, _) {
293293
for f: ast::field_pat in fs {
294-
if !vec::any(bind str::eq(f.ident, _), fields) {
294+
if !vec::any(fields, bind str::eq(f.ident, _)) {
295295
fields += [f.ident];
296296
}
297297
}

trunk/src/comp/middle/trans_closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ fn trans_bind_1(cx: @block_ctxt, outgoing_fty: ty::t,
426426
// Actually construct the closure
427427
let {llbox, box_ty, bcx} = store_environment(
428428
bcx, lltydescs,
429-
env_vals + vec::map({|x| env_expr(x)}, bound),
429+
env_vals + vec::map(bound, {|x| env_expr(x)}),
430430
ty::closure_shared);
431431

432432
// Make thunk

trunk/src/comp/middle/trans_objects.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ fn trans_anon_obj(bcx: @block_ctxt, sp: span, anon_obj: ast::anon_obj,
244244
// methods, not inner ones.
245245
let wrapper_obj: ast::_obj =
246246
{fields:
247-
vec::map(ast_util::obj_field_from_anon_obj_field,
248-
additional_fields),
247+
vec::map(additional_fields,
248+
ast_util::obj_field_from_anon_obj_field),
249249
methods: anon_obj.methods};
250250

251251
let inner_obj_ty: ty::t;
@@ -481,7 +481,7 @@ fn create_vtbl(cx: @local_ctxt, sp: span, outer_obj_ty: ty::t, ob: ast::_obj,
481481
// Filter out any methods that we don't need forwarding slots for
482482
// because they're being overridden.
483483
let f = bind filtering_fn(cx, _, ob.methods);
484-
meths = vec::filter_map(f, meths);
484+
meths = vec::filter_map(meths, f);
485485

486486
// And now add the additional ones, both overriding ones and entirely
487487
// new ones. These will just be normal methods.

trunk/src/comp/middle/tstate/auxiliary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ fn callee_arg_init_ops(fcx: fn_ctxt, callee: node_id) -> [init_op] {
10831083
fn mode_to_op(m: ty::mode) -> init_op {
10841084
alt m { by_move. { init_move } _ { init_assign } }
10851085
}
1086-
vec::map(mode_to_op, callee_modes(fcx, callee))
1086+
vec::map(callee_modes(fcx, callee), mode_to_op)
10871087
}
10881088

10891089
fn anon_bindings(ops: [init_op], es: [@expr]) -> [binding] {

trunk/src/comp/middle/tstate/pre_post_conditions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ fn find_pre_post_exprs(fcx: fn_ctxt, args: [@expr], id: node_id) {
9595
fn get_pp(ccx: crate_ctxt, &&e: @expr) -> pre_and_post {
9696
ret expr_pp(ccx, e);
9797
}
98-
let pps = vec::map(bind get_pp(fcx.ccx, _), args);
98+
let pps = vec::map(args, bind get_pp(fcx.ccx, _));
9999

100100
set_pre_and_post(fcx.ccx, id, seq_preconds(fcx, pps),
101-
seq_postconds(fcx, vec::map(get_post, pps)));
101+
seq_postconds(fcx, vec::map(pps, get_post)));
102102
}
103103

104104
fn find_pre_post_loop(fcx: fn_ctxt, l: @local, index: @expr, body: blk,
@@ -472,7 +472,7 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
472472
postcondition: false_postcond(num_local_vars)};
473473
let g = bind combine_pp(antec_pp, fcx, _, _);
474474
let alts_overall_pp =
475-
vec::foldl::<pre_and_post, pre_and_post>(g, e_pp, alt_pps);
475+
vec::foldl(e_pp, alt_pps, g);
476476
set_pre_and_post(fcx.ccx, e.id, alts_overall_pp.precondition,
477477
alts_overall_pp.postcondition);
478478
}
@@ -669,7 +669,7 @@ fn find_pre_post_block(fcx: fn_ctxt, b: blk) {
669669
for s: @stmt in b.node.stmts { do_one_(fcx, s); }
670670
fn do_inner_(fcx: fn_ctxt, &&e: @expr) { find_pre_post_expr(fcx, e); }
671671
let do_inner = bind do_inner_(fcx, _);
672-
option::map::<@expr, ()>(do_inner, b.node.expr);
672+
option::map::<@expr, ()>(b.node.expr, do_inner);
673673

674674
let pps: [pre_and_post] = [];
675675
for s: @stmt in b.node.stmts { pps += [stmt_pp(fcx.ccx, *s)]; }

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ fn field_idx(sess: session::session, sp: span, id: ast::ident,
17081708
fn get_field(tcx: ctxt, rec_ty: t, id: ast::ident) -> field {
17091709
alt struct(tcx, rec_ty) {
17101710
ty_rec(fields) {
1711-
alt vec::find({|f| str::eq(f.ident, id) }, fields) {
1711+
alt vec::find(fields, {|f| str::eq(f.ident, id) }) {
17121712
some(f) { ret f; }
17131713
}
17141714
}

0 commit comments

Comments
 (0)