about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-12-23 11:56:08 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2019-12-23 11:56:08 -0500
commit65e366064f222502c96d0d39102ea6cea9d4bafa (patch)
treed2972488f7c7b90d83349d85b14037baef428829
parenta916ac22b9f7f1f0f7aba0a41a789b3ecd765018 (diff)
downloadrust-65e366064f222502c96d0d39102ea6cea9d4bafa.tar.gz
rust-65e366064f222502c96d0d39102ea6cea9d4bafa.zip
docs: Iterator adapters have unspecified results after a panic
-rw-r--r--src/libcore/iter/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs
index 80294de714d..0d5af3986fb 100644
--- a/src/libcore/iter/mod.rs
+++ b/src/libcore/iter/mod.rs
@@ -216,6 +216,11 @@
 //! Common iterator adapters include [`map`], [`take`], and [`filter`].
 //! For more, see their documentation.
 //!
+//! If an iterator adapter panics, the iterator will be in an unspecified (but
+//! memory safe) state.  This state is also not guaranteed to stay the same
+//! across versions of Rust, so you should avoid relying on the exact values
+//! returned by an iterator which panicked.
+//!
 //! [`map`]: trait.Iterator.html#method.map
 //! [`take`]: trait.Iterator.html#method.take
 //! [`filter`]: trait.Iterator.html#method.filter