]> git.lizzy.rs Git - rust.git/commitdiff
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)
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.

1  2 
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/common.rs

Simple merge
Simple merge
Simple merge