Skip to content

Commit a68a0e3

Browse files
committed
Add documentation about for used as higher ranked trait bounds
Resolves rust-lang#55416
1 parent 07d3508 commit a68a0e3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/libstd/keyword_docs.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,13 @@ mod fn_keyword { }
286286
//
287287
/// The `for` keyword.
288288
///
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+
/// `for` is primarily used in for-in-loops, but it has a few other pieces of syntactic
290+
/// uses. `for` is used when implementing traits as in `impl Trait for Type` (see
291+
/// [`impl`] for more info on that). `for` is also used for [higher-ranked trait bounds]
292+
/// as in `for<'a> &'a T: PartialEq<i32>`. for-in-loops, or to be more precise, iterator
293+
/// loops, are a simple syntactic sugar over an exceedingly common practice within Rust,
294+
/// which is to loop over an iterator until that iterator returns `None` (or `break` is
295+
/// called).
294296
///
295297
/// ```rust
296298
/// for i in 0..5 {

0 commit comments

Comments
 (0)