Uh oh!
There was an error while loading. Please reload this page.
switch Option to external iterators - #7055
Merged
Merged
Conversation
bstrie
commented
Jun 11, 2013
Contributor
Is there an issue open for this? |
thestinger
commented
Jun 11, 2013
ContributorAuthor
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.
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 Fixesrust-lang#7055
U007D pushed a commit
to U007D/rust-mos
that referenced
this pull request
Aug 21, 2026
7055: Install rustfmt if needed during formatting request r=matklad a=kinnison In order to fixrust-lang#6052 and to fixrust-lang#4249 this PR installs `rustfmt` using `rustup` if `rustfmt --help` fails. In theory we ought to memoise the attempts (both the `--help` and the installation) so that we don't keep retrying something which will fail (e.g. if nightly is missing rustfmt), but this is a first-pass for opinions. In order to make it possible to notify the user of what happened, I added a facility for `GlobalStateSnapshot` to send *messages* to the client indicating what happened. There may be a cleaner way to do this as well but I wasn't sure exactly what might be best given this is my first time in this codebase. It may be worth, longer term, working with `rustup` to provide a way to detect a missing component binary since `rustup` returns `1` if `rustfmt` is not installed, which is not ideal. Co-authored-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a lot more painful than just changing
x.eachtox.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
@mutfailures, 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|becomingfor x.iter |x|and making all the iterator adaptors available.I dropped the run-pass tests for
old_iterbecause there's not much point in fixing a module that's on the way out in the next week or so.