diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-05-27 20:20:17 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-06-01 18:33:47 +0200 |
| commit | cfdbff7c125cbdd5a2b75e526717413718d16111 (patch) | |
| tree | 451f7b5b3a0f7b4a34eba2fc4310b78f0414f8d8 /src/libcore | |
| parent | a11c26f6acb1b8890c36196e88371840c01e201d (diff) | |
| download | rust-cfdbff7c125cbdd5a2b75e526717413718d16111.tar.gz rust-cfdbff7c125cbdd5a2b75e526717413718d16111.zip | |
Change for-loop desugar to not borrow the iterator during the loop
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 5eefa59e7ea..37cc6f98e73 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -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 |
