@@ -130,8 +130,10 @@ fn check_always_applicable(tcx: TyCtxt<'_>, impl1_def_id: LocalDefId, impl2_node
130
130
///
131
131
/// Example
132
132
///
133
+ /// ```ignore (illustrative)
133
134
/// impl<A, B> Foo<A> for B { /* impl2 */ }
134
135
/// impl<C> Foo<Vec<C>> for C { /* impl1 */ }
136
+ /// ```
135
137
///
136
138
/// Would return `S1 = [C]` and `S2 = [Vec<C>, C]`.
137
139
fn get_impl_substs < ' tcx > (
@@ -225,13 +227,17 @@ fn unconstrained_parent_impl_substs<'tcx>(
225
227
///
226
228
/// For example forbid the following:
227
229
///
230
+ /// ```ignore (illustrative)
228
231
/// impl<A> Tr for A { }
229
232
/// impl<B> Tr for (B, B) { }
233
+ /// ```
230
234
///
231
235
/// Note that only consider the unconstrained parameters of the base impl:
232
236
///
237
+ /// ```ignore (illustrative)
233
238
/// impl<S, I: IntoIterator<Item = S>> Tr<S> for I { }
234
239
/// impl<T> Tr<T> for Vec<T> { }
240
+ /// ```
235
241
///
236
242
/// The substs for the parent impl here are `[T, Vec<T>]`, which repeats `T`,
237
243
/// but `S` is constrained in the parent impl, so `parent_substs` is only
@@ -256,8 +262,10 @@ fn check_duplicate_params<'tcx>(
256
262
///
257
263
/// For example forbid the following:
258
264
///
265
+ /// ```ignore (illustrative)
259
266
/// impl<A> Tr for A { }
260
267
/// impl Tr for &'static i32 { }
268
+ /// ```
261
269
fn check_static_lifetimes < ' tcx > (
262
270
tcx : TyCtxt < ' tcx > ,
263
271
parent_substs : & Vec < GenericArg < ' tcx > > ,
0 commit comments