-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Inconsistently documented constraints for IntoIterator::Item #77763
Comments
This is the relevant code for traits: rust/src/librustdoc/html/render/mod.rs Line 2433 in c9a48d1
This is the relevant code for trait bounds: rust/src/librustdoc/html/format.rs Line 154 in c9a48d1
After that it goes into Ty::print() and I'm not sure where it goes. rust/src/librustdoc/html/format.rs Line 352 in c9a48d1
|
Well. I think I found the issue. rust/src/librustdoc/html/format.rs Lines 846 to 847 in c9a48d1
|
Hmm, changing that didn't help - it's always |
The bounds passed to
and for the re-export:
In particular note that |
This looks like the culprit: rust/src/librustdoc/clean/mod.rs Lines 1598 to 1609 in c9a48d1
vec![] is the bindings.
|
This needs larger refactors to rustdoc than I'm comfortable making. rust/src/librustdoc/clean/mod.rs Line 2408 in c9a48d1
which works on the hir, not DefId s, and the HIR is not preserved across crates.
Maybe @GuillaumeGomez is interested in refactoring this? ;) |
Update: The current nightly output is still incorrect: pub trait IntoIterator {
type Item;
type IntoIter: Iterator
where
<Self::IntoIter as Iterator>::Item == Self::Item;
fn into_iter(self) -> Self::IntoIter;
} I am already working on a fix and I have already assigned myself to the duplicates of this issue (#84579 and #102142). |
Awesome, thanks! |
The documentation for
IntoIterator
is inconsistent in how it shows theItem
constraints.The actual trait declaration looks like this:
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 noItem
constraints at all: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.The text was updated successfully, but these errors were encountered: