]> git.lizzy.rs Git - rust.git/blob - src/test/ui/for/for-loop-unconstrained-element-type.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / 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 }