From 0778ac81c8e73b88fdae07e737bfc3b8fd3b92fb Mon Sep 17 00:00:00 2001 From: Tim Nielens Date: Mon, 29 Jan 2018 16:52:22 +0100 Subject: [PATCH] #1121: already fixed, adding a test --- tests/ui/while_loop.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ui/while_loop.rs b/tests/ui/while_loop.rs index b7ef39da8..b4c3eb0f5 100644 --- a/tests/ui/while_loop.rs +++ b/tests/ui/while_loop.rs @@ -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); + } }