]> git.lizzy.rs Git - rust.git/commitdiff
#1121: already fixed, adding a test
authorTim Nielens <tim.nielens@gmail.com>
Mon, 29 Jan 2018 15:52:22 +0000 (16:52 +0100)
committerTim Nielens <tim.nielens@gmail.com>
Mon, 29 Jan 2018 15:52:22 +0000 (16:52 +0100)
tests/ui/while_loop.rs

index b7ef39da8175c020350142cef46e839e795d2c95..b4c3eb0f58e181714ebead484cf0e523a74f6da2 100644 (file)
@@ -193,4 +193,12 @@ fn refutable() {
             break None;
         }
     };
+
+    use std::collections::HashSet;
+    let mut values = HashSet::new();
+    values.insert(1);
+
+    while let Some(&value) = values.iter().next() {
+        values.remove(&value);
+    }
 }