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

switch Option to external iterators #7055

Merged
merged 3 commits into from
Jun 12, 2013
Merged

switch Option to external iterators #7055

merged 3 commits into from
Jun 12, 2013

Conversation

thestinger
Copy link
Contributor

This was a lot more painful than just changing x.each to x.iter().advance . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround.

The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic @mut failures, so those had to be wrapped in blocks except where the scope ends immediately.

Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to for x.each |x| becoming for x.iter |x| and making all the iterator adaptors available.

I dropped the run-pass tests for old_iter because there's not much point in fixing a module that's on the way out in the next week or so.

@bstrie
Copy link
Contributor

bstrie commented Jun 11, 2013

The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic @mut failures, so those had to be wrapped in blocks except where the scope ends immediately.

Is there an issue open for this?

@thestinger
Copy link
Contributor Author

@bstrie: #3511

bors added a commit that referenced this pull request Jun 11, 2013
This was a lot more painful than just changing `x.each` to `x.iter().advance` . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround.

The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic `@mut` failures, so those had to be wrapped in blocks except where the scope ends immediately.

Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to `for x.each |x|` becoming `for x.iter |x|` and making all the iterator adaptors available.

I dropped the run-pass tests for `old_iter` because there's not much point in fixing a module that's on the way out in the next week or so.
@bors bors closed this Jun 12, 2013
@bors bors merged commit bbe3d4a into rust-lang:incoming Jun 12, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 6, 2021
Fix unused_unit macro false positive

changelog: Fix [`unused_unit`] false positive with macros

Fixes rust-lang#7055
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

Successfully merging this pull request may close these issues.

3 participants