The documentation for IntoIterator is inconsistent in how it shows the Item constraints.
The actual trait declaration looks like this:
pub trait IntoIterator {
type Item;
type IntoIter: Iterator<Item = Self::Item>;
fn into_iter(self) -> Self::IntoIter;
}
The nightly core documentation matches this declaration as of 1.49.0-nightly (3525087 2020-10-08). This is good.
However, the nightly std documentation shows no Item constraints at all:
pub trait IntoIterator {
type Item;
type IntoIter: Iterator;
fn into_iter(self) -> Self::IntoIter;
}
The std documentation for 1.48.0-beta.2 is even weirder, using an equality constraint that's not supported (#20041), and this goes all the way back to 1.0.0.
pub trait IntoIterator
where
<Self::IntoIter as Iterator>::Item == Self::Item,
{
type Item;
type IntoIter: Iterator;
fn into_iter(self) -> Self::IntoIter;
}
The documentation for
IntoIteratoris inconsistent in how it shows theItemconstraints.The actual trait declaration looks like this:
The nightly
coredocumentation matches this declaration as of 1.49.0-nightly (3525087 2020-10-08). This is good.However, the nightly
stddocumentation shows noItemconstraints at all:The
stddocumentation for 1.48.0-beta.2 is even weirder, using an equality constraint that's not supported (#20041), and this goes all the way back to 1.0.0.