Skip to content

Commit 216e935

Browse files
committed
---
yaml --- r: 5900 b: refs/heads/master c: 0ce40f6 h: refs/heads/master v: v3
1 parent d582ff6 commit 216e935

File tree

21 files changed

+67
-495
lines changed

21 files changed

+67
-495
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: 050170d2af94ea81b9b964901e4de7eb79583332
2+
refs/heads/master: 0ce40f60e79598c198851154cc978375ed5e7747

trunk/src/comp/metadata/tydecode.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
251251
ret ty::mk_fn(st.tcx, ast::proto_bare, func.args, func.ty, func.cf,
252252
func.cs);
253253
}
254-
'W' {
255-
let func = parse_ty_fn(st, sd);
256-
ret ty::mk_fn(st.tcx, ast::proto_iter, func.args, func.ty, func.cf,
257-
func.cs);
258-
}
259254
'B' {
260255
let func = parse_ty_fn(st, sd);
261256
ret ty::mk_fn(st.tcx, ast::proto_block, func.args, func.ty, func.cf,
@@ -281,7 +276,6 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
281276
while peek(st) as char != ']' {
282277
let proto;
283278
alt next(st) as char {
284-
'W' { proto = ast::proto_iter; }
285279
'f' { proto = ast::proto_bare; }
286280
}
287281
let name = "";

trunk/src/comp/metadata/tyencode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) {
194194
}
195195
fn enc_proto(w: io::writer, proto: proto) {
196196
alt proto {
197-
proto_iter. { w.write_char('W'); }
198197
proto_shared(_) { w.write_char('F'); }
199198
proto_block. { w.write_char('B'); }
200199
proto_bare. { w.write_char('f'); }

trunk/src/comp/middle/alias.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,6 @@ fn visit_expr(cx: @ctx, ex: @ast::expr, sc: scope, v: vt<scope>) {
9898
handled = false;
9999
}
100100
ast::expr_alt(input, arms) { check_alt(*cx, input, arms, sc, v); }
101-
ast::expr_put(val) {
102-
alt val {
103-
some(ex) {
104-
let root = expr_root(*cx, ex, false);
105-
if !is_none(root.mut) {
106-
cx.tcx.sess.span_err(ex.span,
107-
"result of put must be" +
108-
" immutably rooted");
109-
}
110-
visit_expr(cx, ex, sc, v);
111-
}
112-
_ { }
113-
}
114-
}
115-
ast::expr_for_each(decl, call, blk) {
116-
check_for_each(*cx, decl, call, blk, sc, v);
117-
}
118101
ast::expr_for(decl, seq, blk) { check_for(*cx, decl, seq, blk, sc, v); }
119102
ast::expr_path(pt) {
120103
check_var(*cx, ex, pt, ex.id, false, sc);
@@ -424,21 +407,6 @@ fn check_alt(cx: ctx, input: @ast::expr, arms: [ast::arm], sc: scope,
424407
}
425408
}
426409

427-
fn check_for_each(cx: ctx, local: @ast::local, call: @ast::expr,
428-
blk: ast::blk, sc: scope, v: vt<scope>) {
429-
v.visit_expr(call, sc, v);
430-
alt call.node {
431-
ast::expr_call(f, args) {
432-
let new_bs = sc.bs + check_call(cx, f, args);
433-
for proot in pattern_roots(cx.tcx, none, local.node.pat) {
434-
new_bs += [mk_binding(cx, proot.id, proot.span, none,
435-
unsafe_set(proot.mut))];
436-
}
437-
visit::visit_block(blk, {bs: new_bs with sc}, v);
438-
}
439-
}
440-
}
441-
442410
fn check_for(cx: ctx, local: @ast::local, seq: @ast::expr, blk: ast::blk,
443411
sc: scope, v: vt<scope>) {
444412
v.visit_expr(seq, sc, v);

trunk/src/comp/middle/freevars.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ fn collect_freevars(def_map: resolve::def_map, walker: fn@(visit::vt<int>)) ->
4141
visit::visit_expr(expr, depth + 1, v);
4242
}
4343
}
44-
ast::expr_for_each(dcl, x, b) {
45-
v.visit_local(dcl, depth, v);
46-
v.visit_expr(x, depth, v);
47-
v.visit_block(b, depth + 1, v);
48-
}
4944
ast::expr_path(path) {
5045
let def = def_map.get(expr.id), i = 0;
5146
while i < depth {
@@ -91,21 +86,9 @@ fn annotate_freevars(def_map: resolve::def_map, crate: @ast::crate) ->
9186
let vars = collect_freevars(def_map, start_walk);
9287
freevars.insert(nid, vars);
9388
};
94-
let walk_expr =
95-
lambda (expr: @ast::expr) {
96-
alt expr.node {
97-
ast::expr_for_each(local, _, body) {
98-
let start_walk =
99-
lambda (v: visit::vt<int>) { v.visit_block(body, 1, v); };
100-
let vars = collect_freevars(def_map, start_walk);
101-
freevars.insert(body.node.id, vars);
102-
}
103-
_ { }
104-
}
105-
};
10689

10790
let visitor =
108-
visit::mk_simple_visitor(@{visit_fn: walk_fn, visit_expr: walk_expr
91+
visit::mk_simple_visitor(@{visit_fn: walk_fn
10992
with *visit::default_simple_visitor()});
11093
visit::visit_crate(*crate, (), visitor);
11194

trunk/src/comp/middle/resolve.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tag scope {
3737
scope_item(@ast::item);
3838
scope_fn(ast::fn_decl, ast::proto, [ast::ty_param]);
3939
scope_native_item(@ast::native_item);
40-
scope_loop(@ast::local, bool); // there's only 1 decl per loop.
40+
scope_loop(@ast::local); // there's only 1 decl per loop.
4141

4242
scope_block(ast::blk, @mutable uint, @mutable uint);
4343
scope_arm(ast::arm);
@@ -381,9 +381,8 @@ fn visit_arm_with_scope(a: ast::arm, sc: scopes, v: vt<scopes>) {
381381

382382
fn visit_expr_with_scope(x: @ast::expr, sc: scopes, v: vt<scopes>) {
383383
alt x.node {
384-
ast::expr_for(decl, coll, blk) | ast::expr_for_each(decl, coll, blk) {
385-
let f_e = alt x.node { expr_for_each(_, _, _) { true } _ { false } };
386-
let new_sc = cons(scope_loop(decl, f_e), @sc);
384+
ast::expr_for(decl, coll, blk) {
385+
let new_sc = cons(scope_loop(decl), @sc);
387386
v.visit_expr(coll, sc, v);
388387
v.visit_local(decl, new_sc, v);
389388
v.visit_block(blk, new_sc, v);
@@ -589,7 +588,6 @@ fn lookup_in_scope_strict(e: env, sc: scopes, sp: span, name: ident,
589588

590589
fn scope_is_fn(sc: scope) -> bool {
591590
ret alt sc {
592-
scope_fn(_, ast::proto_iter., _) |
593591
scope_fn(_, ast::proto_bare., _) |
594592
scope_native_item(_) {
595593
true
@@ -600,7 +598,7 @@ fn scope_is_fn(sc: scope) -> bool {
600598

601599
fn scope_closes(sc: scope) -> option::t<bool> {
602600
alt sc {
603-
scope_fn(_, ast::proto_block., _) | scope_loop(_, true) { some(true) }
601+
scope_fn(_, ast::proto_block., _) { some(true) }
604602
scope_fn(_, ast::proto_shared(_), _) { some(false) }
605603
_ { none }
606604
}
@@ -662,7 +660,7 @@ fn lookup_in_scope(e: env, sc: scopes, sp: span, name: ident, ns: namespace)
662660
scope_fn(decl, _, ty_params) {
663661
ret lookup_in_fn(name, decl, ty_params, ns);
664662
}
665-
scope_loop(local, _) {
663+
scope_loop(local) {
666664
if ns == ns_value {
667665
alt lookup_in_pat(name, local.node.pat) {
668666
some(did) { ret some(ast::def_binding(did)); }

0 commit comments

Comments
 (0)