]>
Commit | Line | Data |
---|---|---|
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 |
5 | fn f<F: FnMut()>(mut f: F) { |
6 | f(); | |
7 | } | |
223e47cc LB |
8 | |
9 | fn main() { | |
85aaf69f SL |
10 | let mut v: Vec<_> = vec![]; |
11 | f(|| v.push(0)); | |
c34b1796 | 12 | assert_eq!(v, [0]); |
223e47cc | 13 | } |