1 The built-in function traits are generic over a tuple of the function arguments.
2 If one uses angle-bracket notation (`Fn<(T,), Output=U>`) instead of parentheses
3 (`Fn(T) -> U`) to denote the function trait, the type parameter should be a
4 tuple. Otherwise function call notation cannot be used and the trait will not be
5 implemented by closures.
7 The most likely source of this error is using angle-bracket notation without
8 wrapping the function argument type into a tuple, for example:
11 #![feature(unboxed_closures)]
13 fn foo<F: Fn<i32>>(f: F) -> F::Output { f(3) }
16 It can be fixed by adjusting the trait bound like this:
19 #![feature(unboxed_closures)]
21 fn foo<F: Fn<(i32,)>>(f: F) -> F::Output { f(3) }
24 Note that `(T,)` always denotes the type of a 1-tuple containing an element of
25 type `T`. The comma is necessary for syntactic disambiguation.