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

for section of the manual hasn't been updated for iterators #8876

Closed
toqueteos opened this issue Aug 30, 2013 · 5 comments
Closed

for section of the manual hasn't been updated for iterators #8876

toqueteos opened this issue Aug 30, 2013 · 5 comments

Comments

@toqueteos
Copy link
Contributor

(... other than the code examples.)

New docs have updated examples to include the new in syntax but no other mention to in is made on http://static.rust-lang.org/doc/rust.html#for-expressions.

Also grammar production is wrong (doesn't include new "in" syntax).

@toqueteos
Copy link
Contributor Author

Also "in" is missing on keywords list, sending PR for that in a moment.

@huonw
Copy link
Member

huonw commented Aug 30, 2013

It looks like the whole for section is wrong, not just the grammar: e.g. the first sentence:

A for expression is similar to a do expression, in that it provides a special block-form of lambda expression, suited to passing the block function to a higher-order function implementing a loop.

In any case, the grammar is now for_expr : "for" pat "in" expr '{' block '}' ;.

(I'm changing this issue to be more general, and just cover the whole section, which needs a rewrite to reflect reality.)

bors added a commit that referenced this issue Aug 30, 2013
@brandonson
Copy link
Contributor

@toqueteos Are you still looking at rewriting the docs? If not, I may take a poke at it sometime in the semi-near future.

@toqueteos
Copy link
Contributor Author

@singingboyo Feel free to contribute, I didn't make a PR for the "for" section because I'm not that experienced on Rust.

@thestinger
Copy link
Contributor

This could be better documented, but is no longer out-of-date. The iterator tutorial does cover this stuff fairly well too.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 4, 2022
…r=dswij,xFrednet

`cast_abs_to_unsigned`: do not remove cast if it's required

Fixes rust-lang#8873

If `iX` is not cast to `uX` then keep the cast rather than removing it

changelog: [`cast_abs_to_unsigned`]: do not remove cast if it's required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants