]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/unboxed-closures/unboxed-closures-infer-upvar.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / unboxed-closures / unboxed-closures-infer-upvar.rs
CommitLineData
b7449926 1// run-pass
85aaf69f
SL
2// Test that the type variable in the type(`Vec<_>`) of a closed over
3// variable does not interfere with type inference.
223e47cc 4
85aaf69f
SL
5fn f<F: FnMut()>(mut f: F) {
6 f();
7}
223e47cc
LB
8
9fn main() {
85aaf69f
SL
10 let mut v: Vec<_> = vec![];
11 f(|| v.push(0));
c34b1796 12 assert_eq!(v, [0]);
223e47cc 13}