mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
0d7f1e1b48
Clarify panic conditions in `Iterator::last` Follow-up PR to rust-lang/rust#150580. Now `Iterator::last`'s docs specify that it might panic only if the iterator is infinite, rather than if it has more than `usize::MAX` elements. # Motivation This is because `Iterator::last`, unlike `count`, also works on iterators with more than `usize::MAX` elements, but could panic on infinite iterators (as in `Repeat`), as discussed in rust-lang/rust#150580. r? ``@jhpratt``