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

keyword in's doc uses says it requires an Iterator instead of an IntoIterator #74529

Closed
SkiFire13 opened this issue Jul 19, 2020 · 1 comment
Closed
Assignees
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@SkiFire13
Copy link
Contributor

SkiFire13 commented Jul 19, 2020

In the doc for the keyword in it's stated that "The expression immediately following in must implement the Iterator trait."
This is not completly right since it can be followed by anything that implements the IntoIterator trait.
The doc for the keyword for instead correctly cites the IntoIterator trait, althouth it could be improved since it just appears out of thin air when the desugared version is showed, without any prior mentioning.

This issue has been assigned to @Nicholas-Baron via this comment.

@jonas-schievink jonas-schievink added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jul 19, 2020
@Nicholas-Baron
Copy link
Contributor

PR ready for review. I tried to keep the changes to a minimum. Hopefully, the wording is understandable.

I'll just assign myself.
@rustbot claim

@rustbot rustbot self-assigned this Jul 19, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 20, 2020
fix documentation surrounding the `in` and `for` keywords

Addresses rust-lang#74529

The `in` keyword incorrectly referenced the `Iterator` trait. This reference was changed to `IntoIterator` without changing the underlying link.

Additionally, the `IntoIterator` trait was referenced towards the end of the documentation for `for`. An additional reference was added earlier and broadened the existing documentation from any iterator to anything that can be turned into an iterator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants