]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-upvar.rs
Sync rust-lang/portable-simd@5f49d4c8435a25d804b2f375e949cb25479f5be9
[rust.git] / src / test / 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 }