@@ -599,12 +599,12 @@ impl<'a, 'tcx> SubstFolder<'a, 'tcx> {
599599 ///
600600 /// ```
601601 /// type Func<A> = fn(A);
602- /// type MetaFunc = for<'a> fn(Func<&'a int >)
602+ /// type MetaFunc = for<'a> fn(Func<&'a i32 >)
603603 /// ```
604604 ///
605605 /// The type `MetaFunc`, when fully expanded, will be
606606 ///
607- /// for<'a> fn(fn(&'a int ))
607+ /// for<'a> fn(fn(&'a i32 ))
608608 /// ^~ ^~ ^~~
609609 /// | | |
610610 /// | | DebruijnIndex of 2
@@ -613,26 +613,26 @@ impl<'a, 'tcx> SubstFolder<'a, 'tcx> {
613613 /// Here the `'a` lifetime is bound in the outer function, but appears as an argument of the
614614 /// inner one. Therefore, that appearance will have a DebruijnIndex of 2, because we must skip
615615 /// over the inner binder (remember that we count De Bruijn indices from 1). However, in the
616- /// definition of `MetaFunc`, the binder is not visible, so the type `&'a int ` will have a
616+ /// definition of `MetaFunc`, the binder is not visible, so the type `&'a i32 ` will have a
617617 /// De Bruijn index of 1. It's only during the substitution that we can see we must increase the
618618 /// depth by 1 to account for the binder that we passed through.
619619 ///
620620 /// As a second example, consider this twist:
621621 ///
622622 /// ```
623623 /// type FuncTuple<A> = (A,fn(A));
624- /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a int >)
624+ /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a i32 >)
625625 /// ```
626626 ///
627627 /// Here the final type will be:
628628 ///
629- /// for<'a> fn((&'a int , fn(&'a int )))
629+ /// for<'a> fn((&'a i32 , fn(&'a i32 )))
630630 /// ^~~ ^~~
631631 /// | |
632632 /// DebruijnIndex of 1 |
633633 /// DebruijnIndex of 2
634634 ///
635- /// As indicated in the diagram, here the same type `&'a int ` is substituted once, but in the
635+ /// As indicated in the diagram, here the same type `&'a i32 ` is substituted once, but in the
636636 /// first case we do not increase the De Bruijn index and in the second case we do. The reason
637637 /// is that only in the second case have we passed through a fn binder.
638638 fn shift_vars_through_binders < T : TypeFoldable < ' tcx > > ( & self , val : T ) -> T {
0 commit comments