Rollup merge of #67564 - Mark-Simulacrum:iter-adapter-panic, r=LukasKalbertodt

docs: Iterator adapters have unspecified results after a panic

Fixes #58170.

That issue also has rough consensus from 3 members of the library team for this being the behavior we would like to specify.
This commit is contained in:
Yuki Okushi 2019-12-30 14:07:47 +09:00 committed by GitHub
commit 97a7b03298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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