///
/// ```
/// type Func<A> = fn(A);
- /// type MetaFunc = for<'a> fn(Func<&'a i32>)
+ /// type MetaFunc = for<'a> fn(Func<&'a i32>);
/// ```
///
/// The type `MetaFunc`, when fully expanded, will be
- ///
- /// for<'a> fn(fn(&'a i32))
- /// ^~ ^~ ^~~
- /// | | |
- /// | | DebruijnIndex of 2
- /// Binders
- ///
+ /// ```ignore (illustrative)
+ /// for<'a> fn(fn(&'a i32))
+ /// // ^~ ^~ ^~~
+ /// // | | |
+ /// // | | DebruijnIndex of 2
+ /// // Binders
+ /// ```
/// Here the `'a` lifetime is bound in the outer function, but appears as an argument of the
/// inner one. Therefore, that appearance will have a DebruijnIndex of 2, because we must skip
/// over the inner binder (remember that we count De Bruijn indices from 1). However, in the
///
/// ```
/// type FuncTuple<A> = (A,fn(A));
- /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a i32>)
+ /// type MetaFuncTuple = for<'a> fn(FuncTuple<&'a i32>);
/// ```
///
/// Here the final type will be:
- ///
- /// for<'a> fn((&'a i32, fn(&'a i32)))
- /// ^~~ ^~~
- /// | |
- /// DebruijnIndex of 1 |
- /// DebruijnIndex of 2
- ///
+ /// ```ignore (illustrative)
+ /// for<'a> fn((&'a i32, fn(&'a i32)))
+ /// // ^~~ ^~~
+ /// // | |
+ /// // DebruijnIndex of 1 |
+ /// // DebruijnIndex of 2
+ /// ```
/// As indicated in the diagram, here the same type `&'a i32` is substituted once, but in the
/// first case we do not increase the De Bruijn index and in the second case we do. The reason
/// is that only in the second case have we passed through a fn binder.
/// sometimes needed to constrain the type parameters on the impl. For
/// example, in this code:
///
-/// ```
+/// ```ignore (illustrative)
/// struct Foo<T> { }
/// impl<A> Foo<A> { fn method() { } }
/// ```