Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleanup on after #29684 #29731

Merged
merged 1 commit into from
Nov 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,22 +371,21 @@ pub trait Iterator {
///
/// # Implementation notes
///
/// It is not enforced that an iterator implementation yields the
/// declared number of elements. A buggy iterator may yield less
/// than the lower bound or more than the upper bound of elements.
/// It is not enforced that an iterator implementation yields the declared
/// number of elements. A buggy iterator may yield less than the lower bound
/// or more than the upper bound of elements.
///
/// `size_hint()` is primarily intended to be used for optimizations
/// such as reserving space for the elements of the iterator, but
/// must not be trusted to e.g. omit bounds checks in unsafe code.
/// An incorrect implementation of `size_hint()` should not lead to
/// memory safety violations.
/// `size_hint()` is primarily intended to be used for optimizations such as
/// reserving space for the elements of the iterator, but must not be
/// trusted to e.g. omit bounds checks in unsafe code. An incorrect
/// implementation of `size_hint()` should not lead to memory safety
/// violations.
///
/// That said, the implementation should provide a correct
/// estimation, because otherwise it would be a violation of the
/// trait's protocol.
/// That said, the implementation should provide a correct estimation,
/// because otherwise it would be a violation of the trait's protocol.
///
/// The default implementation returns `(0, None)` which is correct
/// for any iterator.
/// The default implementation returns `(0, None)` which is correct for any
/// iterator.
///
/// # Examples
///
Expand Down Expand Up @@ -2750,7 +2749,7 @@ pub trait ExactSizeIterator: Iterator {
/// implementation, you can do so. See the [trait-level] docs for an
/// example.
///
/// This function has the same safety guarantees as [`size_hint()`]
/// This function has the same safety guarantees as the [`size_hint()`]
/// function.
///
/// [trait-level]: trait.ExactSizeIterator.html
Expand Down