]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closures-infer-upvar.rs
Auto merge of #107054 - petrochenkov:effvisdoc3, r=GuillaumeGomez
[rust.git] / tests / ui / unboxed-closures / unboxed-closures-infer-upvar.rs
1 // run-pass
2 // Test that the type variable in the type(`Vec<_>`) of a closed over
3 // variable does not interfere with type inference.
4
5 fn f<F: FnMut()>(mut f: F) {
6     f();
7 }
8
9 fn main() {
10     let mut v: Vec<_> = vec![];
11     f(|| v.push(0));
12     assert_eq!(v, [0]);
13 }