From 7ded8a9066c996e0190d6ffc63a2a8bc1c410ac9 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 15 Jun 2017 12:27:15 -0400 Subject: [PATCH] explain purpose of test --- .../compile-fail/for-loop-unconstrained-element-type.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/compile-fail/for-loop-unconstrained-element-type.rs b/src/test/compile-fail/for-loop-unconstrained-element-type.rs index f7dccc7f2ac1..dd09e4a79ecd 100644 --- a/src/test/compile-fail/for-loop-unconstrained-element-type.rs +++ b/src/test/compile-fail/for-loop-unconstrained-element-type.rs @@ -8,6 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Test that `for` loops don't introduce artificial +// constraints on the type of the binding (`i`). +// Subtle changes in the desugaring can cause the +// type of elements in the vector to (incorrectly) +// fallback to `!` or `()`. + fn main() { for i in Vec::new() { } //~ ERROR type annotations needed }