about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Gregory <czipperz@gmail.com>2019-03-27 01:22:23 -0400
committerChris Gregory <czipperz@gmail.com>2019-03-27 01:23:14 -0400
commita68a0e33d1d6660ad594ae7be3c6c1cca7c1752c (patch)
tree5d053db130a8cb4f3447c584a51be4ad5a0171da
parent07d350897c7f95bb40ae9762ad1e945f95fc37ae (diff)
downloadrust-a68a0e33d1d6660ad594ae7be3c6c1cca7c1752c.tar.gz
rust-a68a0e33d1d6660ad594ae7be3c6c1cca7c1752c.zip
Add documentation about `for` used as higher ranked trait bounds
Resolves #55416
-rw-r--r--src/libstd/keyword_docs.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs
index bef6bc92661..94751cec416 100644
--- a/src/libstd/keyword_docs.rs
+++ b/src/libstd/keyword_docs.rs
@@ -286,11 +286,13 @@ mod fn_keyword { }
 //
 /// The `for` keyword.
 ///
-/// `for` is primarily used in for-in-loops, but it has a few other pieces of syntactic uses such as
-/// `impl Trait for Type` (see [`impl`] for more info on that). for-in-loops, or to be more
-/// precise, iterator loops, are a simple syntactic sugar over an exceedingly common practice
-/// within Rust, which is to loop over an iterator until that iterator returns `None` (or `break`
-/// is called).
+/// `for` is primarily used in for-in-loops, but it has a few other pieces of syntactic
+/// uses.  `for` is used when implementing traits as in `impl Trait for Type` (see
+/// [`impl`] for more info on that).  `for` is also used for [higher-ranked trait bounds]
+/// as in `for<'a> &'a T: PartialEq<i32>`.  for-in-loops, or to be more precise, iterator
+/// loops, are a simple syntactic sugar over an exceedingly common practice within Rust,
+/// which is to loop over an iterator until that iterator returns `None` (or `break` is
+/// called).
 ///
 /// ```rust
 /// for i in 0..5 {