1 #![allow(unused)]
2 
foo<F>(f: F) where F: Fn()3 fn foo<F>(f: F)
4     where F: Fn()
5 {
6 }
7 
main()8 fn main() {
9     // Test that this closure is inferred to `FnOnce` because it moves
10     // from `y.0`. This affects the error output (the error is that
11     // the closure implements `FnOnce`, not that it moves from inside
12     // a `Fn` closure.)
13     let y = (vec![1, 2, 3], 0);
14     let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
15     foo(c);
16 }
17