1 Manual implementation of a `Fn*` trait.
3 Erroneous code example:
10 impl FnOnce<()> for MyClosure { // error
12 extern "rust-call" fn call_once(self, args: ()) -> Self::Output {
13 println!("{}", self.foo);
18 Manually implementing `Fn`, `FnMut` or `FnOnce` is unstable
19 and requires `#![feature(fn_traits, unboxed_closures)]`.
22 #![feature(fn_traits, unboxed_closures)]
28 impl FnOnce<()> for MyClosure { // ok!
30 extern "rust-call" fn call_once(self, args: ()) -> Self::Output {
31 println!("{}", self.foo);
36 The arguments must be a tuple representing the argument list.
37 For more info, see the [tracking issue][iss29625]:
39 [iss29625]: https://github.com/rust-lang/rust/issues/29625