Skip to content

Commit 2917f83

Browse files
committed
---
yaml --- r: 12092 b: refs/heads/master c: c56910f h: refs/heads/master v: v3
1 parent d36f62a commit 2917f83

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
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: 1ffaedac2b222731bdf92a3b19bcb119809b2ba1
2+
refs/heads/master: c56910fc9ac5120d8637d6121753e4dc1670a390
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/ty.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,22 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
666666
ty = mk_tup(cx, new_ts);
667667
}
668668
ty_fn(f) {
669-
let mut new_args: [arg] = [];
670-
for a: arg in f.inputs {
671-
let new_ty = do_fold(cx, fld, a.ty, under_rptr);
672-
new_args += [{mode: a.mode, ty: new_ty}];
669+
alt fld {
670+
fm_rptr(_) {
671+
// Don't recurse into functions, because regions are
672+
// universally quantified, well, universally, at function
673+
// boundaries.
674+
}
675+
_ {
676+
let mut new_args: [arg] = [];
677+
for a: arg in f.inputs {
678+
let new_ty = do_fold(cx, fld, a.ty, under_rptr);
679+
new_args += [{mode: a.mode, ty: new_ty}];
680+
}
681+
let new_output = do_fold(cx, fld, f.output, under_rptr);
682+
ty = mk_fn(cx, {inputs: new_args, output: new_output with f});
683+
}
673684
}
674-
ty = mk_fn(cx, {inputs: new_args,
675-
output: do_fold(cx, fld, f.output, under_rptr)
676-
with f});
677685
}
678686
ty_res(did, subty, tps) {
679687
let mut new_tps = [];

0 commit comments

Comments
 (0)