Skip to content

Commit 42d77fa

Browse files
committed
---
yaml --- r: 15175 b: refs/heads/try c: 3c398d2 h: refs/heads/master i: 15173: 7354e4a 15171: 2f445e4 15167: d234810 v: v3
1 parent 627b6c1 commit 42d77fa

File tree

5 files changed

+107
-121
lines changed

5 files changed

+107
-121
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: ca6636d6b689fe209a210b0eda51e368f01cdb0f
5+
refs/heads/try: 3c398d28a42f85ea5f8fd27d9878806311f0b6ed
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/infer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ impl resolve_methods for infer_ctxt {
834834
}
835835
_ { region }
836836
}
837-
}), typ);
837+
}, false), typ);
838838

839839
let ur = *unresolved;
840840
alt ur {

branches/try/src/rustc/middle/ty.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ fn maybe_walk_ty(ty: t, f: fn(t) -> bool) {
610610
enum fold_mode {
611611
fm_var(fn@(int) -> t),
612612
fm_param(fn@(uint, def_id) -> t),
613-
fm_rptr(fn@(region, bool /* under & */) -> region),
613+
fm_rptr(fn@(region, bool /* under & */) -> region,
614+
bool /* descend into outermost fn */),
614615
fm_general(fn@(t) -> t),
615616
}
616617

@@ -622,7 +623,7 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
622623
alt fld {
623624
fm_var(_) { if !tb.has_vars { ret ty; } }
624625
fm_param(_) { if !tb.has_params { ret ty; } }
625-
fm_rptr(_) { if !tb.has_rptrs { ret ty; } }
626+
fm_rptr(_,_) { if !tb.has_rptrs { ret ty; } }
626627
fm_general(_) {/* no fast path */ }
627628
}
628629

@@ -678,22 +679,27 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
678679
ty = mk_tup(cx, new_ts);
679680
}
680681
ty_fn(f) {
682+
let mut new_fld;
681683
alt fld {
682-
fm_rptr(_) {
684+
fm_rptr(_, false) {
683685
// Don't recurse into functions, because regions are
684686
// universally quantified, well, universally, at function
685687
// boundaries.
688+
ret ty;
686689
}
687-
_ {
688-
let mut new_args: [arg] = [];
689-
for a: arg in f.inputs {
690-
let new_ty = do_fold(cx, fld, a.ty, under_rptr);
691-
new_args += [{mode: a.mode, ty: new_ty}];
692-
}
693-
let new_output = do_fold(cx, fld, f.output, under_rptr);
694-
ty = mk_fn(cx, {inputs: new_args, output: new_output with f});
690+
fm_rptr(f, true) {
691+
new_fld = fm_rptr(f, false);
695692
}
693+
_ { new_fld = fld; }
694+
}
695+
696+
let mut new_args: [arg] = [];
697+
for a: arg in f.inputs {
698+
let new_ty = do_fold(cx, new_fld, a.ty, under_rptr);
699+
new_args += [{mode: a.mode, ty: new_ty}];
696700
}
701+
let new_output = do_fold(cx, new_fld, f.output, under_rptr);
702+
ty = mk_fn(cx, {inputs: new_args, output: new_output with f});
697703
}
698704
ty_res(did, subty, tps) {
699705
let mut new_tps = [];
@@ -711,7 +717,7 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
711717
}
712718
ty_rptr(r, tm) {
713719
let region = alt fld {
714-
fm_rptr(folder) { folder(r, under_rptr) }
720+
fm_rptr(folder, _) { folder(r, under_rptr) }
715721
_ { r }
716722
};
717723
ty = mk_rptr(cx, region,

0 commit comments

Comments
 (0)