From 65e366064f222502c96d0d39102ea6cea9d4bafa Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 23 Dec 2019 11:56:08 -0500 Subject: [PATCH] docs: Iterator adapters have unspecified results after a panic --- src/libcore/iter/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 80294de714d25..0d5af3986fbff 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