about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs
index ee811513487..c91fd16391a 100644
--- a/src/libcore/iter/mod.rs
+++ b/src/libcore/iter/mod.rs
@@ -191,10 +191,12 @@
 //! {
 //!     let result = match IntoIterator::into_iter(values) {
 //!         mut iter => loop {
-//!             let x = match iter.next() {
-//!                 Some(val) => val,
+//!             let next;
+//!             match iter.next() {
+//!                 Some(val) => next = val,
 //!                 None => break,
 //!             };
+//!             let x = next;
 //!             let () = { println!("{}", x); };
 //!         },
 //!     };