about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-15 01:28:05 +0100
committerGitHub <noreply@github.com>2021-12-15 01:28:05 +0100
commitd6c802ee7add3163f5b113d60cf4267d16441c73 (patch)
tree9a0501e6b4727244d111e155f8a6f36a39466857
parent272188eecd59e122d2ad435256c0f65a0f63ccbf (diff)
parent715c562d71f18ceb077482fc22339b3a73816b4e (diff)
downloadrust-d6c802ee7add3163f5b113d60cf4267d16441c73.tar.gz
rust-d6c802ee7add3163f5b113d60cf4267d16441c73.zip
Rollup merge of #91859 - xkr47:patch-2, r=yaahc
Iterator::cycle() — document empty iterator special case
-rw-r--r--library/core/src/iter/traits/iterator.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index 267fa406798..9a9a844f41b 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/core/src/iter/traits/iterator.rs
@@ -3028,7 +3028,8 @@ pub trait Iterator {
     ///
     /// Instead of stopping at [`None`], the iterator will instead start again,
     /// from the beginning. After iterating again, it will start at the
-    /// beginning again. And again. And again. Forever.
+    /// beginning again. And again. And again. Forever. Note that in case the
+    /// original iterator is empty, the resulting iterator will also be empty.
     ///
     /// # Examples
     ///