Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 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 | } |