]> git.lizzy.rs Git - rust.git/commit
auto merge of #7055 : thestinger/rust/iterator, r=catamorphism
authorbors <bors@rust-lang.org>
Tue, 11 Jun 2013 23:19:42 +0000 (16:19 -0700)
committerbors <bors@rust-lang.org>
Tue, 11 Jun 2013 23:19:42 +0000 (16:19 -0700)
commit3f900dc7d1517bbc821989d68f3392d4aae96f93
tree1f8c006deabe41787f5111c47c823c0d2fb12301
parent1175e94de3b6d0f6b35fd8de3599b29267f1adab
parentbbe3d4a9dc7eae6b53871d0a59d56372c2c03479
auto merge of #7055 : thestinger/rust/iterator, r=catamorphism

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.
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/common.rs