]> git.lizzy.rs Git - rust.git/blob - tests/ui/for/for-loop-unconstrained-element-type.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / ui / for / for-loop-unconstrained-element-type.rs
1 // Test that `for` loops don't introduce artificial
2 // constraints on the type of the binding (`i`).
3 // Subtle changes in the desugaring can cause the
4 // type of elements in the vector to (incorrectly)
5 // fallback to `!` or `()`.
6
7 fn main() {
8     for i in Vec::new() { } //~ ERROR type annotations needed
9 }