From 171f7b4eb7fed11f9282eb0c5af5eda1e77f9bc6 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Fri, 18 Aug 2017 17:29:05 +0300 Subject: [PATCH] tests/ui/let_unit: fix comment and example code The previous version would had deadlocked as the Sender remained alive and iterator would had never became complete. Just in case someone decided to run it. --- tests/ui/let_unit.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ui/let_unit.rs b/tests/ui/let_unit.rs index 0b0afccef45..d07cf8ede2f 100644 --- a/tests/ui/let_unit.rs +++ b/tests/ui/let_unit.rs @@ -33,9 +33,11 @@ fn consume_units_with_for_loop() { } assert_eq!(count, 3); - // Same for consuming from some other Iterator<()>. + // Same for consuming from some other Iterator. let (tx, rx) = ::std::sync::mpsc::channel(); tx.send(()).unwrap(); + drop(tx); + count = 0; for _ in rx.iter() { count += 1;