@@ -666,14 +666,22 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
666
666
ty = mk_tup ( cx, new_ts) ;
667
667
}
668
668
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
+ }
673
684
}
674
- ty = mk_fn ( cx, { inputs: new_args,
675
- output: do_fold ( cx, fld, f. output , under_rptr)
676
- with f} ) ;
677
685
}
678
686
ty_res ( did, subty, tps) {
679
687
let mut new_tps = [ ] ;
0 commit comments