@@ -599,12 +599,12 @@ impl<'a, 'tcx> SubstFolder<'a, 'tcx> {
599
599
///
600
600
/// ```
601
601
/// type Func<A> = fn(A);
602
- /// type MetaFunc = for<'a> fn(Func<&'a int >)
602
+ /// type MetaFunc = for<'a> fn(Func<&'a i32 >)
603
603
/// ```
604
604
///
605
605
/// The type `MetaFunc`, when fully expanded, will be
606
606
///
607
- /// for<'a> fn(fn(&'a int ))
607
+ /// for<'a> fn(fn(&'a i32 ))
608
608
/// ^~ ^~ ^~~
609
609
/// | | |
610
610
/// | | DebruijnIndex of 2
@@ -613,26 +613,26 @@ impl<'a, 'tcx> SubstFolder<'a, 'tcx> {
613
613
/// Here the `'a` lifetime is bound in the outer function, but appears as an argument of the
614
614
/// inner one. Therefore, that appearance will have a DebruijnIndex of 2, because we must skip
615
615
/// 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
617
617
/// De Bruijn index of 1. It's only during the substitution that we can see we must increase the
618
618
/// depth by 1 to account for the binder that we passed through.
619
619
///
620
620
/// As a second example, consider this twist:
621
621
///
622
622
/// ```
623
623
/// type FuncTuple<A> = (A,fn(A));
624
- /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a int >)
624
+ /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a i32 >)
625
625
/// ```
626
626
///
627
627
/// Here the final type will be:
628
628
///
629
- /// for<'a> fn((&'a int , fn(&'a int )))
629
+ /// for<'a> fn((&'a i32 , fn(&'a i32 )))
630
630
/// ^~~ ^~~
631
631
/// | |
632
632
/// DebruijnIndex of 1 |
633
633
/// DebruijnIndex of 2
634
634
///
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
636
636
/// first case we do not increase the De Bruijn index and in the second case we do. The reason
637
637
/// is that only in the second case have we passed through a fn binder.
638
638
fn shift_vars_through_binders < T : TypeFoldable < ' tcx > > ( & self , val : T ) -> T {
0 commit comments