From 249e07b237bd3049eb7fd94afe450b7c09b6a3d9 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Wed, 24 Jun 2020 14:53:52 +0200 Subject: Short documentation for the false keyword --- src/libstd/keyword_docs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index a4996d9eee8..cd722458a90 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -387,10 +387,12 @@ mod extern_keyword {} // /// A value of type [`bool`] representing logical **false**. /// -/// The documentation for this keyword is [not yet complete]. Pull requests welcome! +/// Logically `false` is not equal to [`true`]. +/// +/// See the documentation for [`true`] for more information. /// +/// [`true`]: keyword.true.html /// [`bool`]: primitive.bool.html -/// [not yet complete]: https://github.com/rust-lang/rust/issues/34601 mod false_keyword {} #[doc(keyword = "fn")] -- cgit 1.4.1-3-g733a5 From d88cce24238cc76b45e647448d99a87e98cd86b7 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Sat, 18 Jul 2020 23:20:58 +0200 Subject: Add a link to read in the read_exact doc about the guarantees --- src/libstd/io/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index d5af4f25102..aba67df0063 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -741,7 +741,9 @@ pub trait Read { /// No guarantees are provided about the contents of `buf` when this /// function is called, implementations cannot rely on any property of the /// contents of `buf` being true. It is recommended that implementations - /// only write data to `buf` instead of reading its contents. + /// only write data to `buf` instead of reading its contents. The + /// documentation on [`read`] has a more detailed explanation on this + /// subject. /// /// # Errors /// @@ -764,6 +766,7 @@ pub trait Read { /// /// [`File`]s implement `Read`: /// + /// [`read`]: trait.Read.html#tymethod.read /// [`File`]: ../fs/struct.File.html /// [`ErrorKind::Interrupted`]: ../../std/io/enum.ErrorKind.html#variant.Interrupted /// [`ErrorKind::UnexpectedEof`]: ../../std/io/enum.ErrorKind.html#variant.UnexpectedEof -- cgit 1.4.1-3-g733a5 From e88220f86749d88e53c5dbaa421dcaba1889f86c Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Sun, 19 Jul 2020 15:30:32 +0200 Subject: Fix small nit in the link to read --- src/libstd/io/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index aba67df0063..73a6f08df65 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -766,7 +766,7 @@ pub trait Read { /// /// [`File`]s implement `Read`: /// - /// [`read`]: trait.Read.html#tymethod.read + /// [`read`]: Read::read /// [`File`]: ../fs/struct.File.html /// [`ErrorKind::Interrupted`]: ../../std/io/enum.ErrorKind.html#variant.Interrupted /// [`ErrorKind::UnexpectedEof`]: ../../std/io/enum.ErrorKind.html#variant.UnexpectedEof -- cgit 1.4.1-3-g733a5 From b7bf3c83c408c18465bc3a1ea9c98a0023b90d93 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Sun, 19 Jul 2020 15:58:41 +0200 Subject: Remove useless link to bool primitive --- src/libstd/keyword_docs.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index cd722458a90..139b402c335 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -392,7 +392,6 @@ mod extern_keyword {} /// See the documentation for [`true`] for more information. /// /// [`true`]: keyword.true.html -/// [`bool`]: primitive.bool.html mod false_keyword {} #[doc(keyword = "fn")] -- cgit 1.4.1-3-g733a5 From a459fc4e3140cd89457f973045d9c82ef2928698 Mon Sep 17 00:00:00 2001 From: Poliorcetics Date: Sun, 19 Jul 2020 16:28:18 +0200 Subject: Apply suggestions from review Co-authored-by: Joshua Nelson --- src/libstd/keyword_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 139b402c335..a3f5a820d67 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -387,7 +387,7 @@ mod extern_keyword {} // /// A value of type [`bool`] representing logical **false**. /// -/// Logically `false` is not equal to [`true`]. +/// `false` is the logical opposite of [`true`]. /// /// See the documentation for [`true`] for more information. /// -- cgit 1.4.1-3-g733a5 From 940ceb1a4368110df2d24e58896d3753d5596a33 Mon Sep 17 00:00:00 2001 From: Nicholas-Baron Date: Sun, 19 Jul 2020 14:03:52 -0700 Subject: Mentioned IntoIterator earlier in keyword 'for' docs --- src/libstd/keyword_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index d985f10ccb4..66236b45761 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -473,8 +473,8 @@ mod fn_keyword {} /// * `for` is also used for [higher-ranked trait bounds] as in `for<'a> &'a T: PartialEq`. /// /// for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common -/// practice within Rust, which is to loop over an iterator until that iterator returns `None` (or -/// `break` is called). +/// practice within Rust, which is to loop over anything that implements `IntoIterator` until the +/// temporary iterator returns `None` (or `break` is called). /// /// ```rust /// for i in 0..5 { -- cgit 1.4.1-3-g733a5 From 6c493df0f83c6114cddc1ad72929d1f9d4aded1e Mon Sep 17 00:00:00 2001 From: Nicholas-Baron Date: Sun, 19 Jul 2020 14:05:45 -0700 Subject: Mentioned IntoIterator in keyword 'in' docs --- src/libstd/keyword_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 66236b45761..d99399c0869 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -680,7 +680,7 @@ mod impl_keyword {} // /// Iterate over a series of values with [`for`]. /// -/// The expression immediately following `in` must implement the [`Iterator`] trait. +/// The expression immediately following `in` must implement the [`IntoIterator`] trait. /// /// ## Literal Examples: /// @@ -689,7 +689,7 @@ mod impl_keyword {} /// /// (Read more about [range patterns]) /// -/// [`Iterator`]: ../book/ch13-04-performance.html +/// [`IntoIterator`]: ../book/ch13-04-performance.html /// [range patterns]: ../reference/patterns.html?highlight=range#range-patterns /// [`for`]: keyword.for.html mod in_keyword {} -- cgit 1.4.1-3-g733a5 From f268525d966a99ca6881d6f7dc18aafe85c6d28c Mon Sep 17 00:00:00 2001 From: Nicholas-Baron Date: Sun, 19 Jul 2020 14:06:55 -0700 Subject: Linked the earlier mention of IntoIterator in the keyword 'for' docs --- src/libstd/keyword_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index d99399c0869..0ab4a45b779 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -473,7 +473,7 @@ mod fn_keyword {} /// * `for` is also used for [higher-ranked trait bounds] as in `for<'a> &'a T: PartialEq`. /// /// for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common -/// practice within Rust, which is to loop over anything that implements `IntoIterator` until the +/// practice within Rust, which is to loop over anything that implements [`IntoIterator`] until the /// temporary iterator returns `None` (or `break` is called). /// /// ```rust -- cgit 1.4.1-3-g733a5 From 09d55292ed1eca97b997f22656eb7e696e9c1bf1 Mon Sep 17 00:00:00 2001 From: Nicholas Baron Date: Sun, 19 Jul 2020 17:01:36 -0700 Subject: Update src/libstd/keyword_docs.rs Clear up wording regarding the iterator and usage of `break`. Co-authored-by: Josh Triplett --- src/libstd/keyword_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index 0ab4a45b779..d8d7039777c 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -474,7 +474,7 @@ mod fn_keyword {} /// /// for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common /// practice within Rust, which is to loop over anything that implements [`IntoIterator`] until the -/// temporary iterator returns `None` (or `break` is called). +/// iterator returned by `.into_iter()` returns `None` (or the loop body uses `break`). /// /// ```rust /// for i in 0..5 { -- cgit 1.4.1-3-g733a5