diff --git a/library/core/src/iter/sources/repeat.rs b/library/core/src/iter/sources/repeat.rs index f578ae86a9fce..bdad4adccabac 100644 --- a/library/core/src/iter/sources/repeat.rs +++ b/library/core/src/iter/sources/repeat.rs @@ -101,11 +101,21 @@ impl Iterator for Repeat { Some(self.element.clone()) } + /// Consumes the iterator and panics. + /// + /// # Panics + /// + /// This method always panics because `Repeat` is infinite. #[track_caller] fn last(self) -> Option { panic!("iterator is infinite"); } + /// Consumes the iterator and panics. + /// + /// # Panics + /// + /// This method always panics because `Repeat` is infinite. #[track_caller] fn count(self) -> usize { panic!("iterator is infinite");