From b568ab6abb4d1e014e80b98181501773ca12f430 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 15 Jun 2017 12:28:07 -0400 Subject: [PATCH] document purpose of test --- src/test/run-pass/for-loop-lifetime-of-unbound-values.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/run-pass/for-loop-lifetime-of-unbound-values.rs b/src/test/run-pass/for-loop-lifetime-of-unbound-values.rs index 4653a493898e..7a088b513347 100644 --- a/src/test/run-pass/for-loop-lifetime-of-unbound-values.rs +++ b/src/test/run-pass/for-loop-lifetime-of-unbound-values.rs @@ -8,6 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Test when destructors run in a for loop. The intention is +// that the value for each iteration is dropped *after* the loop +// body has executed. This is true even when the value is assigned +// to a `_` pattern (and hence ignored). + use std::cell::Cell; struct Flag<'a>(&'a Cell);