Skip to content

Commit

Permalink
Rollup merge of #67564 - Mark-Simulacrum:iter-adapter-panic, r=LukasK…
Browse files Browse the repository at this point in the history
…albertodt

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.
  • Loading branch information
JohnTitor authored Dec 30, 2019
2 parents 2c46dd1 + 65e3660 commit 97a7b03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97a7b03

Please sign in to comment.