Skip to content

Unlock for i in 0..n loops! (by bumping rust-toolchain to nightly-2021-03-17) #493

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Mar 17, 2021
Merged

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Mar 15, 2021

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 from mem::swap.
So while mem::swap still doesn't work for us (as rust-lang/rust#83019 wasn't approved), most things only use mem::replace, and that's in fact the case for Range's Iterator impl, which was the last thing that had been blocking for i in 0..n.

And after this nightly bump, we now have e.g. this loop in mouse-shader:

    for i in 0..3 {
        painter.fill(
            mouse_button(i),
            // ...
        );
    }

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.

@XAMPPRocky

This comment has been minimized.

@VZout VZout removed their request for review March 15, 2021 09:26
@eddyb

This comment has been minimized.

@eddyb

This comment has been minimized.

@eddyb eddyb added the s: blocked PRs blocked on external factors. label Mar 15, 2021
@eddyb eddyb enabled auto-merge (rebase) March 16, 2021 20:02
@eddyb eddyb changed the title Unlock for i in 0..n loops! (by bumping rust-toolchain to nightly-2021-03-15) Unlock for i in 0..n loops! (by bumping rust-toolchain to nightly-2021-03-17) Mar 17, 2021
@eddyb eddyb merged commit a0b4de4 into EmbarkStudios:main Mar 17, 2021
@eddyb eddyb deleted the rustup branch March 17, 2021 01:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
s: blocked PRs blocked on external factors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants