What guarantees does core::iter::Repeat give around observing calls to clone? #81292
Labels
A-iterators
Area: Iterators
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Currently,
core::iter::Repeat::nth
callscore::iter::Repeat::next
n
times.This allows a struct with interior mutability or other global state and a custom clone implementation to observe the number of times it has been cloned.
Currently, this program outputs:
Would it be possible to override the implementations of some
Iterator
methods that have default implementations without breaking any documented contract?The text was updated successfully, but these errors were encountered: