Skip to content

Commit e2ab205

Browse files
committed
---
yaml --- r: 11882 b: refs/heads/master c: 337d860 h: refs/heads/master v: v3
1 parent f7266ba commit e2ab205

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1745ac9c61010b416673070d466b5007ed48540b
2+
refs/heads/master: 337d860a8777a761267daaad9b561787b10e7c87
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/last_use.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,36 @@ fn visit_expr(ex: @expr, cx: ctx, v: visit::vt<ctx>) {
163163
}
164164
expr_call(f, args, _) {
165165
v.visit_expr(f, cx, v);
166-
let i = 0u, fns = [];
166+
let fns = [];
167167
let arg_ts = ty::ty_fn_args(ty::expr_ty(cx.tcx, f));
168-
for arg in args {
168+
vec::iter2(args, arg_ts) {|arg, arg_t|
169169
alt arg.node {
170170
expr_fn(_, _, _, _) | expr_fn_block(_, _)
171-
if is_blockish(ty::ty_fn_proto(arg_ts[i].ty)) {
171+
if is_blockish(ty::ty_fn_proto(arg_t.ty)) {
172172
fns += [arg];
173173
}
174174
_ {
175-
alt ty::arg_mode(cx.tcx, arg_ts[i]) {
175+
alt ty::arg_mode(cx.tcx, arg_t) {
176176
by_mutbl_ref { clear_if_path(cx, arg, v, false); }
177177
_ { v.visit_expr(arg, cx, v); }
178178
}
179179
}
180180
}
181-
i += 1u;
182181
}
183182
for f in fns { v.visit_expr(f, cx, v); }
183+
vec::iter2(args, arg_ts) {|arg, arg_t|
184+
alt arg.node {
185+
expr_path(_) {
186+
alt ty::arg_mode(cx.tcx, arg_t) {
187+
by_ref | by_val | by_mutbl_ref {
188+
clear_if_path(cx, arg, v, false);
189+
}
190+
_ {}
191+
}
192+
}
193+
_ {}
194+
}
195+
}
184196
}
185197
_ { visit::visit_expr(ex, cx, v); }
186198
}

0 commit comments

Comments
 (0)