Change for-loop desugar to not borrow the iterator during the loop

This commit is contained in:
John Kåre Alsaker
2017-05-27 20:20:17 +02:00
parent a11c26f6ac
commit cfdbff7c12
9 changed files with 138 additions and 83 deletions

View File

@@ -191,10 +191,11 @@
//! {
//! let result = match IntoIterator::into_iter(values) {
//! mut iter => loop {
//! match iter.next() {
//! Some(x) => { println!("{}", x); },
//! let x = match iter.next() {
//! Some(val) => val,
//! None => break,
//! }
//! };
//! let () = { println!("{}", x); };
//! },
//! };
//! result