@@ -130,8 +130,10 @@ fn check_always_applicable(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node
130130///
131131/// Example
132132///
133+ /// ```ignore (illustrative)
133134/// impl<A, B> Foo<A> for B { /* impl2 */ }
134135/// impl<C> Foo<Vec<C>> for C { /* impl1 */ }
136+ /// ```
135137///
136138/// Would return `S1 = [C]` and `S2 = [Vec<C>, C]`.
137139fn get_impl_substs < ' tcx > (
@@ -225,13 +227,17 @@ fn unconstrained_parent_impl_substs<'tcx>(
225227///
226228/// For example forbid the following:
227229///
230+ /// ```ignore (illustrative)
228231/// impl<A> Tr for A { }
229232/// impl<B> Tr for (B, B) { }
233+ /// ```
230234///
231235/// Note that only consider the unconstrained parameters of the base impl:
232236///
237+ /// ```ignore (illustrative)
233238/// impl<S, I: IntoIterator<Item = S>> Tr<S> for I { }
234239/// impl<T> Tr<T> for Vec<T> { }
240+ /// ```
235241///
236242/// The substs for the parent impl here are `[T, Vec<T>]`, which repeats `T`,
237243/// but `S` is constrained in the parent impl, so `parent_substs` is only
@@ -256,8 +262,10 @@ fn check_duplicate_params<'tcx>(
256262///
257263/// For example forbid the following:
258264///
265+ /// ```ignore (illustrative)
259266/// impl<A> Tr for A { }
260267/// impl Tr for &'static i32 { }
268+ /// ```
261269fn check_static_lifetimes < ' tcx > (
262270 tcx : TyCtxt < ' tcx > ,
263271 parent_substs : & Vec < GenericArg < ' tcx > > ,
0 commit comments