Skip to content

Commit

Permalink
explain purpose of test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jun 15, 2017
1 parent a80840f commit d5fd8fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/compile-fail/for-loop-unconstrained-element-type.rs
Expand Up @@ -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
}

0 comments on commit d5fd8fe

Please sign in to comment.