From: bors Date: Fri, 25 Jul 2014 02:21:14 +0000 (+0000) Subject: auto merge of #15809 : pcwalton/rust/dedesugar-for, r=pnkfelix X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b9035c26e2c4368b39c8daa979f669d10d484825;p=rust.git auto merge of #15809 : pcwalton/rust/dedesugar-for, r=pnkfelix librustc: Stop desugaring `for` expressions and translate them directly. This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator for MyStruct { fn next(&mut self) -> Option { ... } } Closes #15392. [breaking-change] --- b9035c26e2c4368b39c8daa979f669d10d484825