Unlock for i in 0..n
loops! (by bumping rust-toolchain to nightly-2021-03-17)
#493
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.
Most of the changes are uninteresting (and in their own commit), and were already part of #490.
What's new is @m-ou-se landed rust-lang/rust#83022 in nightly, decoupling
mem::replace
frommem::swap
.So while
mem::swap
still doesn't work for us (as rust-lang/rust#83019 wasn't approved), most things only usemem::replace
, and that's in fact the case forRange
'sIterator
impl, which was the last thing that had been blockingfor i in 0..n
.And after this nightly bump, we now have e.g. this loop in
mouse-shader
:However, we/I haven't had a chance to test more complicated patterns of iterators, and it would be great if everyone started experimenting with all kinds of iterators (either base ones or combinators etc.), to get a feel for what works and what doesn't.