@@ -286,11 +286,16 @@ mod fn_keyword { }
286
286
//
287
287
/// The `for` keyword.
288
288
///
289
- /// `for` is primarily used in for-in-loops, but it has a few other pieces of syntactic uses such as
290
- /// `impl Trait for Type` (see [`impl`] for more info on that). for-in-loops, or to be more
291
- /// precise, iterator loops, are a simple syntactic sugar over an exceedingly common practice
292
- /// within Rust, which is to loop over an iterator until that iterator returns `None` (or `break`
293
- /// is called).
289
+ /// The `for` keyword is used in many syntactic locations:
290
+ ///
291
+ /// * `for` is used in for-in-loops (see below).
292
+ /// * `for` is used when implementing traits as in `impl Trait for Type` (see [`impl`] for more info
293
+ /// on that).
294
+ /// * `for` is also used for [higher-ranked trait bounds] as in `for<'a> &'a T: PartialEq<i32>`.
295
+ ///
296
+ /// for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common
297
+ /// practice within Rust, which is to loop over an iterator until that iterator returns `None` (or
298
+ /// `break` is called).
294
299
///
295
300
/// ```rust
296
301
/// for i in 0..5 {
@@ -347,6 +352,8 @@ mod fn_keyword { }
347
352
/// For more information on for-loops, see the [Rust book] or the [Reference].
348
353
///
349
354
/// [`impl`]: keyword.impl.html
355
+ /// [higher-ranked trait bounds]:
356
+ /// https://doc.rust-lang.org/nightly/reference/trait-bounds.html#higher-ranked-trait-bounds
350
357
/// [`IntoIterator`]: iter/trait.IntoIterator.html
351
358
/// [Rust book]:
352
359
/// https://doc.rust-lang.org/book/2018-edition/ch03-05-control-flow.html#looping-through-a-collection-with-for
0 commit comments